Compare commits

...

28 Commits

Author SHA1 Message Date
Frieder Schlesier 4576c96a57 install_arch: install libreoffice with i3 2022-10-01 19:46:15 +02:00
Frieder Schlesier 3c5e81f907 update README 2022-10-01 19:45:55 +02:00
Frieder Schlesier b5e643b585 on my own machines, all git dirs should be safe 2022-10-01 19:45:13 +02:00
Frieder Schlesier 936670acbe updates 2022-08-24 21:04:46 +02:00
Frieder Schlesier 90739079f6 updates and cleanup 2022-04-02 10:33:53 +02:00
Frieder Schlesier 05c6dc5cd7 updates for tower at new location 2022-04-02 10:19:58 +02:00
Frieder Schlesier 2d9fcee0dc move tower to archlinux 2022-04-02 10:19:52 +02:00
Frieder Schlesier 46b6522a1d updates for desktop 2022-04-02 10:19:07 +02:00
Frieder Schlesier 039a897afa even more updates 2022-04-02 10:19:07 +02:00
Frieder Schlesier 6037bcbf6f fix org-capture, ssh-agent, git pull rebase, some aliases 2022-04-02 10:19:00 +02:00
Frieder Schlesier 0022753800 fix builds with $SUDO 2022-04-02 10:16:20 +02:00
fschl 3831dc151e mostly happy with sway setup, not decided on status bar 2022-04-02 10:14:36 +02:00
Frieder Schlesier fbd3688b28 syncthing: add systemd autostart on login 2022-04-02 10:07:22 +02:00
Frieder Schlesier 0aa12c59af even more updates 2022-04-02 10:06:21 +02:00
Frieder Schlesier bed6b665ef first draft for org-publish configs 2022-03-31 21:46:57 +02:00
Frieder Schlesier f0b3fa98a2 updates 2022-03-31 21:46:35 +02:00
Frieder Schlesier 2b9c2d976d update org-capture templates 2022-02-13 21:00:57 +01:00
Frieder Schlesier 92b2c7f208 fix org-capture, ssh-agent, git pull rebase, some aliases 2022-02-12 23:20:53 +01:00
Frieder Schlesier 011902d18d updates 2022-02-12 16:51:21 +01:00
Frieder Schlesier f2925f2c65 add fzf bindings to bash 2022-01-28 23:05:52 +01:00
Frieder Schlesier 170187d08c fix builds with $SUDO 2022-01-27 20:02:27 +01:00
fschl d9e336de5d update sway config 2021-12-02 12:21:25 +01:00
fschl a330adaf1e add swaylock-effects 2021-11-10 16:29:36 +01:00
fschl 8641139d8e update sway config (vpn, notifications, automount) 2021-11-10 10:20:45 +01:00
fschl 8cef869e32 mostly happy with sway setup, not decided on status bar 2021-11-04 23:42:24 +01:00
Frieder Schlesier 9cd1afc1fd update README 2021-10-30 10:08:36 +02:00
Frieder Schlesier 1eb000772b scripts/install.sh: prepare split between i3 and sway desktops 2021-10-30 10:08:00 +02:00
Frieder Schlesier 8c977bc737 symcthing: add systemd autostart on login 2021-10-30 10:06:40 +02:00
30 changed files with 1937 additions and 1034 deletions

View File

@ -2,10 +2,12 @@ alias ..='cd ..'
alias ...='cd ../..'
alias ....='cd ../../..'
alias .....='cd ../../../..'
alias rs='rsync --progress -v'
alias rs='rsync --progress -vur '
alias up='sudo apt update && sudo apt upgrade'
alias upnodock='sudo apt-mark hold docker-ce docker-ce-cli && sudo apt update && sudo apt upgrade && sudo apt-mark unhold docker-ce docker-ce-cli'
alias cat='bat'
alias rg='ripgrep'
alias ll='ls -ahlF'
alias la='ls -Ah'
alias l='ls -CF'
@ -37,8 +39,12 @@ alias dvl='docker volume ls'
alias dip="docker container inspect -f '{{ .NetworkSettings.IPAddress }}'" # call with <container name> or ID
alias dih="docker container inspect -f '{{ .Config.Hostname }}'" # call with <container name> or ID
alias dstats="docker stats "'$(sudo docker ps -aq)' # shows stats thingy for all containers
alias drmsc="docker container ls -a | grep Exited | awk '{print $1}' | xargs docker container rm" # removes stopped containers
alias drmdi="docker image remove "'$(docker image ls -q -f dangling=true)' # removes non-tagged images
alias drmsc="docker container prune"
#alias drmsc="docker container ls -a | grep Exited | awk '{print $1}' | xargs docker container rm" # removes stopped containers
alias drmdi="docker image prune"
#alias drmdi="docker image remove "'$(docker image ls -q -f dangling=true)' # removes non-tagged images
# docker swarm
alias dss='docker stack services '

13
.bashrc
View File

@ -35,9 +35,6 @@ shopt -s histappend
HISTSIZE=1000000
HISTFILESIZE=20000000
export TERMINAL="rxvt-unicode-256color";
export TERM="rxvt-unicode-256color";
# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize
@ -114,3 +111,13 @@ if ! shopt -oq posix; then
. /etc/bash_completion
fi
fi
. "$HOME/.cargo/env"
if [ -z "$SSH_AUTH_SOCK" ] ; then
eval `ssh-agent -s`
# ssh-add
fi
# BEGIN_KITTY_SHELL_INTEGRATION
if test -n "$KITTY_INSTALLATION_DIR" -a -e "$KITTY_INSTALLATION_DIR/shell-integration/bash/kitty.bash"; then source "$KITTY_INSTALLATION_DIR/shell-integration/bash/kitty.bash"; fi
# END_KITTY_SHELL_INTEGRATION

381
.config/kitty/kitty.conf Normal file
View File

@ -0,0 +1,381 @@
# vim:fileencoding=utf-8:ft=conf
# Font family. You can also specify different fonts for the
# bold/italic/bold-italic variants. By default they are derived automatically,
# by the OSes font system. Setting them manually is useful for font families
# that have many weight variants like Book, Medium, Thick, etc. For example:
# font_family Operator Mono Book
# bold_font Operator Mono Medium
# italic_font Operator Mono Book Italic
# bold_italic_font Operator Mono Medium Italic
#
# You can get a list of full family names available on your computer by running
# kitty list-fonts
font_family Meslo LG M Regular
italic_font auto
bold_font auto
bold_italic_font auto
# Font size (in pts)
font_size 10.0
# The amount the font size is changed by (in pts) when increasing/decreasing
# the font size in a running terminal.
font_size_delta 2
# Adjust the line height.
# You can use either numbers, which are interpreted as pixels or percentages
# (number followed by %), which are interpreted as percentages of the
# unmodified line height. You can use negative pixels or percentages less than
# 100% to reduce line height (but this might cause rendering artifacts).
adjust_line_height 0
# Change the sizes of the lines used for the box drawing unicode characters
# These values are in pts. They will be scaled by the monitor DPI to arrive at
# a pixel value. There must be four values corresponding to thin, normal, thick,
# and very thick lines;
box_drawing_scale 0.001, 1, 1.5, 2
# The opacity of the background. A number between 0 and 1, where 1 is opaque and 0 is fully transparent.
# This will only work if supported by the OS (for instance, when using a compositor under X11). Note
# that it only sets the default background color's opacity. This is so that
# things like the status bar in vim, powerline prompts, etc. still look good.
# But it means that if you use a color theme with a background color in your
# editor, it will not be rendered as transparent. Instead you should change the
# default background color in your kitty config and not use a background color
# in the editor color scheme. Or use the escape codes to set the terminals
# default colors in a shell script to launch your editor.
# Be aware that using a value less than 1.0 is a (possibly significant) performance hit.
background_opacity 1.0
# The cursor shape can be one of (block, beam, underline)
cursor_shape block
# The interval (in seconds) at which to blink the cursor. Set to zero to
# disable blinking. Note that numbers smaller than repaint_delay will be
# limited to repaint_delay.
cursor_blink_interval 0.0
# Stop blinking cursor after the specified number of seconds of keyboard inactivity. Set to
# zero to never stop blinking.
cursor_stop_blinking_after 15.0
# Number of lines of history to keep in memory for scrolling back
scrollback_lines 10000
# Program with which to view scrollback in a new window. The scrollback buffer is passed as
# STDIN to this program. If you change it, make sure the program you use can
# handle ANSI escape sequences for colors and text formatting.
scrollback_pager less +G -R
# When viewing scrollback in a new window, put it in a new tab as well
scrollback_in_new_tab no
# Wheel scroll multiplier (modify the amount scrolled by the mouse wheel). Use negative
# numbers to change scroll direction.
wheel_scroll_multiplier 5.0
# The interval between successive clicks to detect double/triple clicks (in seconds)
click_interval 0.5
# Characters considered part of a word when double clicking. In addition to these characters
# any character that is marked as an alpha-numeric character in the unicode
# database will be matched.
select_by_word_characters :@-./_~?&=%+#
# Hide mouse cursor after the specified number of seconds of the mouse not being used. Set to
# zero to disable mouse cursor hiding.
mouse_hide_wait 3.0
# Set the active window to the window under the mouse when moving the mouse around
focus_follows_mouse no
# The enabled window layouts. A comma separated list of layout names. The special value * means
# all layouts. The first listed layout will be used as the startup layout.
# For a list of available layouts, see the file layouts.py
enabled_layouts *
# If enabled, the window size will be remembered so that new instances of kitty will have the same
# size as the previous instance. If disabled, the window will initially have size configured
# by initial_window_width/height, in pixels.
remember_window_size no
initial_window_width 640
initial_window_height 400
# Delay (in milliseconds) between screen updates. Decreasing it, increases
# frames-per-second (FPS) at the cost of more CPU usage. The default value
# yields ~100 FPS which is more than sufficient for most uses.
repaint_delay 10
# Delay (in milliseconds) before input from the program running in the terminal
# is processed. Note that decreasing it will increase responsiveness, but also
# increase CPU usage and might cause flicker in full screen programs that
# redraw the entire screen on each loop, because kitty is so fast that partial
# screen updates will be drawn.
input_delay 3
# Visual bell duration. Flash the screen when a bell occurs for the specified number of
# seconds. Set to zero to disable.
visual_bell_duration 0.0
# Enable/disable the audio bell. Useful in environments that require silence.
enable_audio_bell yes
# The modifier keys to press when clicking with the mouse on URLs to open the URL
open_url_modifiers ctrl+shift
# The program with which to open URLs that are clicked on. The special value "default" means to
# use the operating system's default URL handler.
open_url_with default
# The modifiers to use rectangular selection (i.e. to select text in a
# rectangular block with the mouse)
rectangle_select_modifiers ctrl+alt
# Choose whether to use the system implementation of wcwidth() (used to
# control how many cells a character is rendered in). If you use the system
# implementation, then kitty and any programs running in it will agree. The
# problem is that system implementations often are based on outdated unicode
# standards and get the width of many characters, such as emoji, wrong. So if
# you are using kitty with programs that have their own up-to-date wcwidth()
# implementation, set this option to no, otherwise set it to yes.
use_system_wcwidth no
# The value of the TERM environment variable to set
term xterm-kitty
# The width (in pts) of window borders. Will be rounded to the nearest number of pixels based on screen resolution.
# Note that borders are displayed only when more than one window is visible. They are meant to separate multiple windows.
window_border_width 1
# The window margin (in pts) (blank area outside the border)
window_margin_width 0
# The window padding (in pts) (blank area between the text and the window border)
window_padding_width 0
# The color for the border of the active window
active_border_color #00ff00
# The color for the border of inactive windows
inactive_border_color #cccccc
# Fade the text in inactive windows by the specified amount (a number between
# zero and one, with 0 being fully faded).
inactive_text_alpha 1.0
# Tab-bar customization
active_tab_foreground #d3d4c4
active_tab_background #404552
active_tab_font_style normal
inactive_tab_foreground #7c838f
inactive_tab_background #383c4a
inactive_tab_font_style normal
tab_separator " ┇ "
# The color and style for highlighting URLs on mouse-over. url_style can be one of:
# none, single, double, curly
url_color #0087BD
url_style curly
cursor #93a1a1
# The 16 terminal colors. There are 8 basic colors, each color has a dull and
# bright version.
# solarized dark higher contrast
# https://github.com/dexpota/kitty-themes/blob/master/themes/Solarized_Dark_Higher_Contrast.conf
# background #001e26
# foreground #9bc1c2
# cursor #f34a00
# selection_background #003747
# color0 #002731
# color8 #006388
# color1 #d01b24
# color9 #f4153b
# color2 #6bbe6c
# color10 #50ee84
# color3 #a57705
# color11 #b17e28
# color4 #2075c7
# color12 #178dc7
# color5 #c61b6e
# color13 #e14d8e
# color6 #259185
# color14 #00b29e
# color7 #e9e2cb
# color15 #fcf4dc
# selection_foreground #001e26
# https://github.com/dexpota/kitty-themes/blob/master/themes/Relaxed_Afterglow.conf
# Relaxed Afterglow by Michael Kühnel <mail@michael-kuehnel.de>, https://github.com/Relaxed-Theme/relaxed-terminal-themes
# This work is licensed under the terms of the MIT license.
# For a copy, see https://opensource.org/licenses/MIT.
background #353a44
foreground #d9d9d9
cursor #d9d9d9
selection_foreground #d8d8d8
selection_background #6a7984
color0 #151515
color1 #bc5653
color2 #909d63
color3 #ebc17a
color4 #6a8799
color5 #b06698
color6 #c9dfff
color7 #d9d9d9
color8 #636363
color9 #bc5653
color10 #a0ac77
color11 #ebc17a
color12 #7eaac7
color13 #b06698
color14 #acbbd0
color15 #f7f7f7
# Key mapping
# For a list of key names, see: http://www.glfw.org/docs/latest/group__keys.html
# For a list of modifier names, see: http://www.glfw.org/docs/latest/group__mods.html
#
# You can use the special action no_op to unmap a keyboard shortcut that is
# assigned in the default configuration.
#
# You can combine multiple actions to be triggered by a single shortcut, using the
# syntax below:
# map key combine <separator> action1 <separator> action2 <separator> action3 ...
# For example:
# map ctrl+shift+e combine : new_window : next_layout
# this will create a new window and switch to the next available layout
# Clipboard
map ctrl+shift+v paste_from_clipboard
map ctrl+shift+s no_op
map ctrl+shift+c copy_to_clipboard
map shift+insert no_op
# You can also pass the contents of the current selection to any program using
# pass_selection_to_program. By default, the system's open program is used, but
# you can specify your own, for example:
# map ctrl+shift+o pass_selection_to_program firefox
map ctrl+shift+o no_op
# Scrolling
map ctrl+shift+up no_op
map ctrl+shift+down no_op
map ctrl+shift+k no_op
map ctrl+shift+j no_op
map ctrl+shift+page_up no_op
map ctrl+shift+page_down no_op
map ctrl+shift+home no_op
map ctrl+shift+end no_op
map ctrl+shift+h no_op
# Window management
map ctrl+shift+enter no_op
# map ctrl+n new_os_window
# map ctrl+w close_window
map ctrl+shift+] no_op
map ctrl+shift+[ no_op
map ctrl+shift+f no_op
map ctrl+shift+1 no_op
map ctrl+shift+2 no_op
map ctrl+shift+3 no_op
map ctrl+shift+4 no_op
map ctrl+shift+5 no_op
map ctrl+shift+6 no_op
map ctrl+shift+7 no_op
map ctrl+shift+8 no_op
map ctrl+shift+9 no_op
map ctrl+shift+0 no_op
# You can open a new window running an arbitrary program, for example:
# map ctrl+shift+y new_window mutt
#
# You can pass the current selection to the new program by using the @selection placeholder
# map ctrl+shift+y new_window less @selection
#
# You can even send the contents of the current screen + history buffer as stdin using
# the placeholders @text (which is the plain text) and @ansi (which includes text styling escape codes)
# For example, the following command opens the scrollback buffer in less in a new window.
# map ctrl+shift+y new_window @ansi less +G -R
#
# You can open a new window with the current working directory set to the
# working directory of the current window using
# map ctrl+alt+enter new_window_with_cwd
# Tab management
map ctrl+shift+] next_tab
map ctrl+shift+[ previous_tab
# map ctrl+t new_tab
# map ctrl+q close_tab
map ctrl+shift+l no_op
map ctrl+shift+. move_tab_forward
map ctrl+shift+, move_tab_backward
# You can also create shortcuts to go to specific tabs, with 1 being the first tab
# map ctrl+alt+1 goto_tab 1
# map ctrl+alt+2 goto_tab 2
# Just as with new_window above, you can also pass the name of arbitrary
# commands to run when using new_tab and use new_tab_with_cwd.
# Miscellaneous
# map ctrl+equal increase_font_size
# map ctrl+minus decrease_font_size
# map ctrl+0 restore_font_size
# map ctrl+shift+f11 no_op
# Sending arbitrary text on shortcut key presses
# You can tell kitty to send arbitrary (UTF-8) encoded text to
# the client program when pressing specified shortcut keys. For example:
# map ctrl+alt+a send_text all Special text
# This will send "Special text" when you press the Ctrl+Alt+a key combination.
# The text to be sent is a python string literal so you can use escapes like
# \x1b to send control codes or \u21fb to send unicode characters (or you can
# just input the unicode characters directly as UTF-8 text). The first argument
# to send_text is the keyboard modes in which to activate the shortcut. The possible
# values are normal or application or kitty or a comma separated combination of them.
# The special keyword all means all modes. The modes normal and application refer to
# the DECCKM cursor key mode for terminals, and kitty refers to the special kitty
# extended keyboard protocol. Another example, that outputs a word and then moves the cursor
# to the start of the line (same as pressing the Home key):
# map ctrl+alt+a send_text normal Word\x1b[H
# map ctrl+alt+a send_text application Word\x1bOH
# Symbol mapping (special font for specified unicode code points). Map the
# specified unicode codepoints to a particular font. Useful if you need special
# rendering for some symbols, such as for Powerline. Avoids the need for
# patched fonts. Each unicode code point is specified in the form U+<code point
# in hexadecimal>. You can specify multiple code points, separated by commas
# and ranges separated by hyphens. symbol_map itself can be specified multiple times.
# Syntax is:
#
# symbol_map codepoints Font Family Name
#
# For example:
#
# symbol_map U+E0A0-U+E0A2,U+E0B0-U+E0B3 PowerlineSymbols
# OS specific tweaks
# Hide the kitty window's title bar on macOS.
macos_hide_titlebar no
# Use the option key as an alt key. With this set to no, kitty will use
# the macOS native Option+Key = unicode character behavior. This will
# break any Alt+key keyboard shortcuts in your terminal programs, but you
# can use the macOS unicode input technique.
macos_option_as_alt yes
# The number is a percentage of maximum volume.
# See man XBell for details.
x11_bell_volume 80
# Prefer color emoji fonts when available. Note that this only works
# on systems such as Linux that use fontconfig. On other OSes, the emoji
# font used is system dependent. It can be overriden using symbol_map in the kitty
# configuration.
prefer_color_emoji yes

View File

@ -544,3 +544,19 @@ wireshark() {
jess/wireshark
}
woeusb() {
del_stopped woeusb
docker run -it \
-v /etc/localtime:/etc/localtime:ro \
-v /tmp/.X11-unix:/tmp/.X11-unix \
-v $(pwd):/home/woe \
-v /dev/:/shared_devs \
-v /mnt/:/mnted_devs \
-e DISPLAY=unix$DISPLAY \
--privileged \
--name woeusb \
${DOCKER_REPO_PREFIX}/woeusb
}

View File

@ -27,3 +27,9 @@
helper = cache
[color]
ui = true
[pull]
rebase = true
[init]
defaultBranch = main
[safe]
directory = *

View File

@ -29,7 +29,7 @@ floating_modifier $mod
hide_edge_borders both # none|vertical|horizontal|both
# start a terminal
bindsym $mod+Return exec urxvt
bindsym $mod+Return exec kitty
# kill focused window
bindsym $mod+Shift+q kill
@ -42,6 +42,7 @@ bindsym $mod+d exec dmenu_run
# bindsym $mod+d exec --no-startup-id i3-dmenu-desktop
bindsym Ctrl+Shift+l exec i3lock-fancy
bindsym $mod+o exec speedcrunch
# change focus
bindsym $mod+j focus left
@ -84,6 +85,7 @@ bindsym $mod+Shift+space floating toggle
bindsym $mod+space focus mode_toggle
# float some applications
for_window [class="Tor Browser"] floating enable
for_window [title="SpeedCrunch"] floating enable
bindsym $mod+a focus parent # focus the parent container
@ -105,26 +107,28 @@ set $WS8 "8 "
set $WS9 "9 "
assign [class="^Firefox$"] $WS1
assign [class="^DebugScreen"] $WS3
assign [class="^Eclipse$"] $WS5
assign [class="^Thunderbird$"] $WS4
assign [class=".*ee.*ass.*"] $WS8
# https://faq.i3wm.org/question/3726/workspace-output-multiple-values/index.html%3Fanswer=3731.html#post-id-3731
set $LAPTOP LVDS-1
set $CENTER HDMI-1
set $RIGHT VGA-1
# set $LAPTOP LVDS-1
set $CENTER DP-0
set $RIGHT DP-3
set $LEFT DVI-D-0
# monitor settings
bindsym $mod+m mode "monitor"
mode "monitor" {
# only laptop
bindsym 1 exec xrandr --output $LAPTOP --auto --primary --output $CENTER --off $RIGHT --off
# HDMI main, laptop secondary
# CENTER main, RIGHT secondary
bindsym 2 exec xrandr --output $CENTER --primary --auto --output $LAPTOP --auto --left-of $CENTER --output $RIGHT --off
# HDMI main, laptop left, VGA right, *not* supported on X230
bindsym 3 exec xrandr --output $CENTER --primary --auto --output $LAPTOP --auto --left-of $CENTER --output $RIGHT --auto --right-of $CENTER
# HDMI main, VGA right, laptop off
bindsym 4 exec xrandr --output $CENTER --primary --auto --output $RIGHT --right-of $CENTER --rotate left --auto --output $LAPTOP --off
bindsym 3 exec xrandr --output $CENTER --primary --auto --output $LEFT --auto --left-of $CENTER --output $RIGHT --auto --right-of $CENTER
# CENTER main, RIGHT right, rotated
bindsym 4 exec xrandr --output $CENTER --primary --auto --output $RIGHT --auto --right-of $CENTER --rotate left --output $LAPTOP --off --output $LEFT --auto --left-of $CENTER --rotate right
# VGA main, laptop left, HDMI off
bindsym 8 exec xrandr --output $RIGHT --primary --auto --output $LAPTOP --auto --left-of $RIGHT --output $CENTER --off
# HDMI main, VGA right, laptop off
@ -136,15 +140,12 @@ mode "monitor" {
bindsym $mod+m mode "default"
}
bindsym $mod+p exec xrandr-toggle
workspace $WS1 output $CENTER
workspace $WS2 output $CENTER
workspace $WS3 output $LAPTOP
workspace $WS4 output $LAPTOP
workspace $WS5 output $CENTER
workspace $WS8 output $LAPTOP
workspace $WS9 output $LAPTOP
workspace $WS3 output $RIGHT
workspace $WS4 output $RIGHT
workspace $WS8 output $RIGHT
workspace $WS9 output $RIGHT
# switch to workspace
bindsym $mod+1 workspace $WS1
@ -209,56 +210,35 @@ mode "resize" {
bindsym $mod+r mode "resize"
# Start i3bar to display a workspace bar (plus the system information i3status
# finds out, if available)
bar {
# i3blocks: http://kumarcode.com/Colorful-i3/
# status_command i3blocks -c ~/.i3/i3blocks.conf
colors {
# separator #268bd2
background #111b16
statusline #b3c4c6
focused_workspace #7d9683 #6c71c4 #fdf6e3
active_workspace #fdf6e3 #6c71c4 #fdf6e3
inactive_workspace #002b36 #586e75 #002b36
urgent_workspace #d33682 #d33682 #fdf6e3
}
output $LAPTOP
font pango:DejaVu Sans, FontAwesome 9
# position top
output $CENTER
font pango:DejaVu Sans Mono, FontAwesome 7
status_command i3status --config ~/.i3/status.conf
status_command /usr/bin/i3status-rs /home/fschl/dotfiles/.i3/status-rust.toml
colors {
separator #166616
background #222222
statusline #166616
focused_workspace #0088CC #0088CC #ffffff
active_workspace #333333 #333333 #ffffff
inactive_workspace #333333 #333333 #888888
urgent_workspace #2f343a #900000 #ffffff
}
}
bar {
# output $CENTER
output $RIGHT
output $LEFT
status_command i3status --config ~/.i3/status_small.conf
tray_output $LAPTOP
tray_output $CENTER
}
# auto run commands
# set background
# use the same background as slim (login manager)
# this file is an alias to something in /home/jessie/Pictures
#exec --no-startup-id feh --bg-fill /usr/share/slim/themes/default/background.jpg
# run the merge for good colors
#exec xrdb -merge /home/jessie/.Xresources
#exec xrdb -merge /home/jessie/.Xdefaults
# startup programs
exec amixer set Master 1+ off
exec amixer set Master 54
exec --no-startup-id nm-applet
exec --no-startup-id xrandr --output LVDS1 --left-of VGA1 --auto
exec --no-startup-id xrandr --output VGA1 --auto
#exec --no-startup-id clipit
exec --no-startup-id xrandr --output $CENTER --primary --auto --output $RIGHT --auto --right-of $CENTER --rotate left --output $LAPTOP --off --output $LEFT --auto --left-of $CENTER --rotate right
exec --no-startup-id i3-msg 'workspace $WS1; exec firefox;'
exec --no-startup-id i3-msg 'workspace $WS2; exec emacs'
exec --no-startup-id i3-msg 'exec thunderbird'
exec --no-startup-id i3-msg 'exec keepassxc'
# exec --no-startup-id i3-msg 'exec nextcloud'
exec --no-startup-id i3-msg 'workspace $WS3; exec urxvt;'
exec --no-startup-id i3-msg 'workspace $WS3; exec kitty;'

111
.i3/status-rust.toml Normal file
View File

@ -0,0 +1,111 @@
[theme]
name = "semi-native"
# theme = "solarized-dark"
[theme.overrides]
separator = "<span font='5'>|</span>"
[icons]
name = "awesome"
[[block]]
block = "pomodoro"
length = 25
break_length = 5
message = " Take a break!"
break_message = "Back to work!"
notifier = "i3nag"
[icons.overrides]
pomodoro = ""
pomodoro_started = ""
pomodoro_stopped = "⏹"
pomodoro_paused = "⏸"
pomodoro_break = ""
# [[block]]
# block = "disk_space"
# path = "/"
# info_type = "available"
# unit = "GB"
# interval = 20
# warning = 1.5
# alert = 0.8
# alert_absolute = true
# format = "{icon}/{available}"
[[block]]
block = "disk_space"
path = "/home"
info_type = "available"
unit = "GB"
interval = 20
warning = 20.0
alert = 10.0
alert_absolute = true
format = "{icon}/home {available}"
# [[block]]
# block = "docker"
# interval = 2
# format = "{running}/{total} | {images}"
[[block]]
block = "memory"
display_type = "memory"
format_mem = "{mem_used_percents}"
format_swap = "{swap_used_percents}"
[[block]]
block = "cpu"
interval = 5
[[block]]
block = "load"
interval = 5
format = "{1m}"
[[block]]
block = "net"
device = "enp31s0"
format = "eth {ip} {speed_down;K*b} {graph_down;K*b}"
interval = 5
# [[block]]
# block = "net"
# device = "wlp3s0"
# on_click = "alacritty -e nmtui"
# format = "{ssid} {signal_strength} {ip} {speed_down;K*b}"
# # format = "{ssid} {signal_strength} {ip} {speed_down;K*b} {graph_down;K*b}"
# interval = 5
[[block]]
block = "sound"
format = "{volume}"
show_volume_when_muted = true
# [[block]]
# block = "sound"
# name = "Mic"
# format = "{output_name} {volume}"
# show_volume_when_muted = true
# [[block]]
# block = "battery"
# # driver = "upower"
# driver = "sysfs"
# format = "{percentage} {time}"
# allow_missing = true
# [[block]]
# block = "networkmanager"
# on_click = "alacritty -e nmtui"
# interface_name_exclude = ["br\\-[0-9a-f]{12}", "docker\\d+"]
# interface_name_include = []
# ap_format = "{ssid^10}"
[[block]]
block = "time"
timezone = "Europe/Berlin"
interval = 5
format = "%a %Y-%m-%d %R:%S"

View File

@ -12,42 +12,37 @@ general {
color_good = "#26F582"
color_degraded = "#f4d430"
color_bad = "#EE6B6F"
color_bad = "#ddbb6f"
}
order += "disk /"
order += "disk /var"
order += "disk /home"
order += "disk /media/driveBay"
#order += "run_watch Docker"
#order += "run_watch DHCP"
order += "path_exists VPN"
# order += "disk /media/driveBay"
order += "run_watch Docker"
order += "run_watch DHCP"
# order += "path_exists VPN"
#order += "ipv6"
order += "wireless wlp3s0"
order += "ethernet fschl-vpn"
order += "ethernet enp0s25"
order += "ethernet enp31s0"
order += "volume Master"
order += "battery 0"
#order += "cpu_temperature 0"
# order += "cpu_temperature 0"
order += "memory"
order += "load"
#order += "tztime local"
order += "tztime DE"
order += "tztime local"
# order += "tztime DE"
#order += "tztime KG"
# order += "tztime UK"
# look for icons: https://fontawesome.com/icons?d=gallery
wireless wlp3s0 {
format_up = " %essid(%quality) %ip"
format_down = "-"
}
ethernet fschl-vpn {
# if you use %speed, i3status requires root privileges
format_up = "VPN: %ip "
format_down = "VPN:-"
format_up = "fschl-vpn: %ip"
format_down = "fschl-vpn: -"
}
ethernet enp0s25 {
ethernet enp31s0 {
# if you use %speed, i3status requires root privileges
format_up = "E: %ip (%speed)"
format_down = "E:-"
@ -77,7 +72,7 @@ tztime local {
tztime DE {
format = "DE %Y-%m-%d (%V) %a %H:%M:%S"
timezone = "Europe/Berlin"
timezone = "Europe/Berlin"
}
tztime UK {
@ -99,6 +94,11 @@ cpu_temperature 0 {
path = "/sys/devices/platform/coretemp.0/hwmon/hwmon1/temp1_input"
}
memory {
format = "RAM %used/%total"
#%free %total , %available avail, %used used"
}
disk "/" {
format = "/ %avail"
}
@ -115,10 +115,10 @@ disk "/media/driveBay" {
format = "/ %avail"
}
volume Master {
format = " %volume"
format_muted = " %volume"
device = "default"
mixer = "Master"
mixer_idx = 0
}
# volume Master {
# format = " %volume"
# format_muted = " %volume"
# device = "default"
# mixer = "Master"
# mixer_idx = 0
# }

View File

@ -22,7 +22,7 @@ order += "run_watch DHCP"
order += "path_exists VPN"
order += "wireless wlp3s0"
# order += "ethernet eth0"
order += "ethernet enp0s25"
order += "ethernet enp31s0"
order += "volume master"
order += "battery 0"
order += "load"
@ -39,13 +39,8 @@ battery 0 {
}
wireless wlp3s0 {
format_up = " %essid (%quality)"
format_down = " -"
}
# ethernet eth0 {
ethernet enp0s25 {
ethernet enp31s0 {
# if you use %speed, i3status requires root privileges
format_up = "E: up"
format_down = "E: down"

5
.path
View File

@ -1,4 +1,3 @@
export PATH=${PATH}:/usr/local/go/bin:/home/fschl/go/bin
#export GOROOT=/usr/local/go/bin
# export GOPATH=/home/fschl/projects/go_projects
export PATH=${PATH}:/usr/local/go/bin:/home/fschl/go/bin
. "$HOME/.cargo/env"

View File

@ -21,3 +21,4 @@ if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
fi
. "$HOME/.cargo/env"

View File

@ -32,7 +32,8 @@ This function should only modify configuration layer settings."
;; List of configuration layers to load.
dotspacemacs-configuration-layers
'(
'(javascript
systemd
;; ----------------------------------------------------------------
;; Example of useful layers you may want to use right away.
;; Uncomment some layer names and press `SPC f e R' (Vim style) or
@ -49,18 +50,29 @@ This function should only modify configuration layer settings."
helm
html
latex
(lsp :variables
lsp-rust-server
'rust-analyzer)
markdown
org
(org :variables
org-enable-roam-support t)
plantuml
python
ranger
rust
(rust :variables rust-backend 'lsp)
shell
shell-scripts
spell-checking
;; shell-scripts
;; spell-checking
syntax-checking
version-control
yaml)
yaml
;; (shell :variables
;; shell-default-height 30
;; shell-default-position 'bottom)
;; spell-checking
;; syntax-checking
;; version-control
treemacs)
;; List of additional packages that will be installed without being wrapped
;; in a layer (generally the packages are installed only and should still be
@ -70,7 +82,10 @@ This function should only modify configuration layer settings."
;; `dotspacemacs/user-config'. To use a local version of a package, use the
;; `:location' property: '(your-package :location "~/path/to/your-package/")
;; Also include the dependencies as they will not be resolved automatically.
dotspacemacs-additional-packages '()
dotspacemacs-additional-packages '(
org-tree-slide
)
;; A list of packages that cannot be updated.
dotspacemacs-frozen-packages '()
@ -247,9 +262,9 @@ It should only modify the values of Spacemacs settings."
dotspacemacs-default-font '("DejaVu Sans Mono"
:size 11
:weight normal
:width normal
:powerline-scale 1.0)
;; The leader key
:width normal)
;; The leader key (default "SPC")
dotspacemacs-leader-key "SPC"
;; The key used for Emacs commands `M-x' (after pressing on the leader key).
@ -403,7 +418,7 @@ It should only modify the values of Spacemacs settings."
;; :size-limit-kb 1000)
;; When used in a plist, `visual' takes precedence over `relative'.
;; (default nil)
dotspacemacs-line-numbers nil
dotspacemacs-line-numbers t
;; Code folding method. Possible values are `evil', `origami' and `vimish'.
;; (default 'evil)
@ -468,7 +483,7 @@ It should only modify the values of Spacemacs settings."
;; performance issues, instead of calculating the frame title by
;; `spacemacs/title-prepare' all the time.
;; (default "%I@%S")
dotspacemacs-frame-title-format "%I@%S"
dotspacemacs-frame-title-format "%I@%t %f (%p)"
;; Format specification for setting the icon title format
;; (default nil - same as frame-title-format)
@ -515,7 +530,7 @@ It should only modify the values of Spacemacs settings."
dotspacemacs-home-shorten-agenda-source nil
;; If non-nil then byte-compile some of Spacemacs files.
dotspacemacs-byte-compile t))
dotspacemacs-byte-compile nil))
(defun dotspacemacs/user-env ()
"Environment variables setup.
@ -558,36 +573,122 @@ you should place your code here."
auto-completion-enable-snippets-in-popup t
auto-completion-enable-help-tooltip t)))
(with-eval-after-load 'org
(setq org-roam-directory (file-truename "~/org-roam"))
(org-roam-db-autosync-mode)
(require 'ox-publish)
(require 'ox-rss)
(setq org-export-html-coding-system 'utf-8-unix)
(setq org-html-doctype "html5")
(defvar fschlde-html-head "<link type='text/css' rel='stylesheet' href='../css/plain.css'>")
(setq fschlde-html-footer " <footer>\nfschl.de 2018-2022\n</footer>")
(setq org-publish-project-alist
'(("website"
:components ("org-journal", "project-notes", "org-sites", "blog-rss", "blog-images"))
("org-journal"
:base-directory "~/Documents/Org/"
:base-extension "org"
:publishing-directory "~/projects/blog-fschlde/reads/"
:recursive nil
:publishing-function org-html-publish-to-html
:headline-levels 4
:with-author t
:with-creator nil
:with-date t
:with-toc t
:with-drawers nil
:html-link-home "/"
:html-head nil ;; cleans up anything that would have been in there.
;; :html-head-extra ,my-blog-extra-head
:html-head-include-default-style nil
:html-head-include-scripts nil
;; :html-preamble my-blog-header
;; :html-postamble ,my-blog-footer
)
("project-notes"
:base-directory "~/projects/"
:base-extension "org"
:publishing-directory "~/projects/blog-fschlde/projects/"
:recursive nil
:publishing-function org-html-publish-to-html
:headline-levels 4)
("org-sites"
:base-directory "~/projects/fschlde-static/"
:base-extension "org"
:publishing-directory "~/projects/fschlde-static/"
:recursive t
:publishing-function org-html-publish-to-html
:html-link-home "/"
;; :html-head ,fschlde-html-head ;; cleans up anything that would have been in there.
:html-head-include-default-style nil
:html-head-include-scripts nil
:with-drawers nil
:with-creator nil
;; :html-head-extra fschlde-html-head
;; :html-postamble fschlde-html-footer
:headline-levels 4)
)
)
(setq org-default-notes-file "~/Documents/Org/tasks.org")
(setq org-agenda-files
(quote ("~/Documents/Org/tasks.org"
"~/Documents/Org/journal.org"
"~/Documents/Org/private.org"
"~/Documents/Org/projects.org"
"~/Documents/Org/watchlist.org"
"~/Documents/Org/birthdays.org")))
(defun fschl/create-org-letter ()
"Create a new letter in ~/Documents/letters/ with filename and date"
(interactive)
(let ((name (read-string "Filename: ")))
(expand-file-name (format "%s.org" name) "~/Documents/letters/") ))
;; https://orgmode.org/manual/Template-elements.html
;; https://orgmode.org/manual/Template-expansion.html
(setq org-capture-templates
'(("t" "todo list item" ; name
entry ; type
(file+headline org-default-notes-file "Tasks")
"* TODO %?\n DEADLINE: %^T") ; template
("T" "todo list item with source" ; name
entry ; type
(file+headline org-default-notes-file "Tasks")
"* TODO %?\n %a \n DEADLINE: %^T \n %i") ; template
'(("t" "todo list item" entry
(file+olp+datetree "~/Documents/Org/tasks.org")
"* TODO %?\n SCHEDULED: %^T"
:tree-type month
)
("T" "todo list item with source" entry
(file+olp+datetree "~/Documents/Org/tasks.org")
"* TODO %?\n %a \n SCHEDULED: %^T \n %^G \n"
:tree-type month
)
("m" "scheduled meeting" ; name
entry ; type
(file+headline org-default-notes-file "Tasks")
"* MEETING %?\n SCHEDULED: %^T\n %a") ; template
("r" "Todo research some website/software" entry
(file+olp+datetree "~/Documents/Org/tasks.org")
"* TODO %?\n SCHEDULED: %^T \n %^L \n"
:tree-type month
)
("l" "letter to Documents/letters/<datetime.org>"
entry (file fschl/create-org-letter)
"* %? \n\n * \n\n "
)
("m" "Schedule a meeting" entry
(file+headline "~/Documents/Org/tasks.org")
"* MEETING %?\n SCHEDULED: %^T\n %a"
)
("p" "phone call" ; name
entry ; type
(file+headline org-default-notes-file "Tasks")
"* PHONE %?\n %i\n %a") ; template
("p" "Schedule a phone call" entry
(file+headline "~/Documents/Org/tasks.org")
"* PHONE %?\n SCHEDULED: %^T\\n %a"
)
("a" "Articles"
entry (file+weektree "~/Documents/Org/journal.org")
"* %? \n%x \n %u\n- $?")
("a" "Articles: keep notes of online articles"
entry
(file+datetree "~/Documents/Org/journal.org")
"* %? \n%x \n %u\n- $?"
:tree-type month
:kill-buffer t
:empty-lines-before 1)
)
)
@ -625,8 +726,7 @@ This function is called at the very end of Spacemacs initialization."
;; If there is more than one, they won't work right.
'(evil-want-Y-yank-to-eol nil)
'(package-selected-packages
(quote
(systemd company-auctex auctex flycheck-pos-tip pos-tip flycheck docker json-mode tablist docker-tramp json-snatcher json-reformat unfill mwim web-mode tagedit slim-mode scss-mode sass-mode pug-mode less-css-mode helm-css-scss haml-mode emmet-mode company-web web-completion-data go-guru go-eldoc company-go go-mode yaml-mode smeargle orgit org-projectile org-category-capture org-present org-pomodoro alert log4e gntp org-mime org-download mmm-mode markdown-toc markdown-mode magit-gitflow htmlize helm-gitignore helm-company helm-c-yasnippet gnuplot gitignore-mode gitconfig-mode gitattributes-mode git-timemachine git-messenger git-link git-gutter-fringe+ git-gutter-fringe fringe-helper git-gutter+ git-gutter gh-md fuzzy evil-magit magit magit-popup git-commit ghub treepy let-alist graphql with-editor diff-hl company-statistics company auto-yasnippet yasnippet ac-ispell auto-complete dockerfile-mode ws-butler winum which-key volatile-highlights vi-tilde-fringe uuidgen use-package toc-org spaceline powerline restart-emacs request rainbow-delimiters popwin persp-mode pcre2el paradox spinner org-plus-contrib org-bullets open-junk-file neotree move-text macrostep lorem-ipsum linum-relative link-hint indent-guide hydra hungry-delete hl-todo highlight-parentheses highlight-numbers parent-mode highlight-indentation helm-themes helm-swoop helm-projectile helm-mode-manager helm-make projectile pkg-info epl helm-flx helm-descbinds helm-ag google-translate golden-ratio flx-ido flx fill-column-indicator fancy-battery eyebrowse expand-region exec-path-from-shell evil-visualstar evil-visual-mark-mode evil-unimpaired evil-tutor evil-surround evil-search-highlight-persist evil-numbers evil-nerd-commenter evil-mc evil-matchit evil-lisp-state smartparens evil-indent-plus evil-iedit-state iedit evil-exchange evil-escape evil-ediff evil-args evil-anzu anzu evil goto-chg undo-tree eval-sexp-fu highlight elisp-slime-nav dumb-jump f dash s diminish define-word column-enforce-mode clean-aindent-mode bind-map bind-key auto-highlight-symbol auto-compile packed aggressive-indent adaptive-wrap ace-window ace-link ace-jump-helm-line helm avy helm-core popup async))))
'(helm-rg systemd journalctl-mode company-auctex auctex flycheck-pos-tip pos-tip flycheck docker json-mode tablist docker-tramp json-snatcher json-reformat unfill mwim web-mode tagedit slim-mode scss-mode sass-mode pug-mode less-css-mode helm-css-scss haml-mode emmet-mode company-web web-completion-data go-guru go-eldoc company-go go-mode yaml-mode smeargle orgit org-projectile org-category-capture org-present org-pomodoro alert log4e gntp org-mime org-download mmm-mode markdown-toc markdown-mode magit-gitflow htmlize helm-gitignore helm-company helm-c-yasnippet gnuplot gitignore-mode gitconfig-mode gitattributes-mode git-timemachine git-messenger git-link git-gutter-fringe+ git-gutter-fringe fringe-helper git-gutter+ git-gutter gh-md fuzzy evil-magit magit magit-popup git-commit ghub treepy let-alist graphql with-editor diff-hl company-statistics company auto-yasnippet yasnippet ac-ispell auto-complete dockerfile-mode ws-butler winum which-key volatile-highlights vi-tilde-fringe uuidgen use-package toc-org spaceline powerline restart-emacs request rainbow-delimiters popwin persp-mode pcre2el paradox spinner org-plus-contrib org-bullets open-junk-file neotree move-text macrostep lorem-ipsum linum-relative link-hint indent-guide hydra hungry-delete hl-todo highlight-parentheses highlight-numbers parent-mode highlight-indentation helm-themes helm-swoop helm-projectile helm-mode-manager helm-make projectile pkg-info epl helm-flx helm-descbinds helm-ag google-translate golden-ratio flx-ido flx fill-column-indicator fancy-battery eyebrowse expand-region exec-path-from-shell evil-visualstar evil-visual-mark-mode evil-unimpaired evil-tutor evil-surround evil-search-highlight-persist evil-numbers evil-nerd-commenter evil-mc evil-matchit evil-lisp-state smartparens evil-indent-plus evil-iedit-state iedit evil-exchange evil-escape evil-ediff evil-args evil-anzu anzu evil goto-chg undo-tree eval-sexp-fu highlight elisp-slime-nav dumb-jump f dash s diminish define-word column-enforce-mode clean-aindent-mode bind-map bind-key auto-highlight-symbol auto-compile packed aggressive-indent adaptive-wrap ace-window ace-link ace-jump-helm-line helm avy helm-core popup async)))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.

View File

@ -1,24 +0,0 @@
bind -n M-Left select-pane -L
bind -n M-Right select-pane -R
bind -n M-Up select-pane -U
bind -n M-Down select-pane -D
set-window-option -g window-status-current-bg yellow
# force a reload of the config file
unbind r
bind r source-file ~/.tmux.conf
# quick pane cycling
unbind M-s
bind -n M-s select-pane -t :.+
# pane splitting like in emacs
unbind M-2
bind -n M-2 split-window -h
unbind M-4
bind -n M-4 split-window
#unbind C-W
#bind -n C-W confirm-before -p "kill-pane #W? (y/n)" kill-window

View File

@ -1,434 +0,0 @@
#!/usr/bin/perl
#
# On-the-fly adjusting of the font size in urxvt
#
# Copyright (c) 2008 David O'Neill
# 2012 Noah K. Tilton <noahktilton@gmail.com>
# 2012-2013 Jan Larres <jan@majutsushi.net>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
#
# URL: https://github.com/majutsushi/urxvt-font-size
#
# Based on:
# https://github.com/dave0/urxvt-font-size
# https://github.com/noah/urxvt-font
#
#:META:X_RESOURCE:%.step:interger:font size increase/decrease step
=head1 NAME
font-size - interactive font size setter
=head1 USAGE
Put the font-size script into $HOME/.urxvt/ext/ and add it to the list
of enabled perl-extensions in ~/.Xresources:
URxvt.perl-ext-common: ...,font-size
Add some keybindings:
URxvt.keysym.C-Up: font-size:increase
URxvt.keysym.C-Down: font-size:decrease
URxvt.keysym.C-S-Up: font-size:incglobal
URxvt.keysym.C-S-Down: font-size:decglobal
Note that for urxvt versions older than 9.21 the resources have to look like this:
URxvt.keysym.C-Up: perl:font-size:increase
URxvt.keysym.C-Down: perl:font-size:decrease
URxvt.keysym.C-S-Up: perl:font-size:incglobal
URxvt.keysym.C-S-Down: perl:font-size:decglobal
Supported functions:
=over 2
=item * increase/decrease:
increase or decrease the font size of the current terminal.
=item * incglobal/decglobal:
same as above and also adjust the X server values so all newly
started terminals will use the same fontsize.
=item * incsave/decsave:
same as incglobal/decglobal and also modify the ~/.Xresources
file so the changed font sizes will persist over a restart of
the X server or a reboot.
=back
You can also change the step size that the script will use to increase
the font size:
URxvt.font-size.step: 4
The default step size is 1. This means that with this setting a
size change sequence would be for example 8->12->16->20 instead of
8->9->10->11->12 etc. Please note that many X11 fonts are only
available in specific sizes, though, and odd sizes are often not
available, resulting in an effective step size of 2 instead of 1
in that case.
=cut
use strict;
use warnings;
my %escapecodes = (
"font" => 710,
"boldFont" => 711,
"italicFont" => 712,
"boldItalicFont" => 713
);
sub on_start
{
my ($self) = @_;
$self->{step} = $self->x_resource("%.step") || 1;
foreach my $type (qw(font boldFont italicFont boldItalicFont)) {
$self->{$type} = $self->x_resource($type) || "undef";
}
}
# Needed for backwards compatibility with < 9.21
sub on_user_command
{
my ($self, $cmd) = @_;
my $step = $self->{step};
if ($cmd eq "font-size:increase") {
fonts_change_size($self, $step, 0);
} elsif ($cmd eq "font-size:decrease") {
fonts_change_size($self, -$step, 0);
} elsif ($cmd eq "font-size:incglobal") {
fonts_change_size($self, $step, 1);
} elsif ($cmd eq "font-size:decglobal") {
fonts_change_size($self, -$step, 1);
} elsif ($cmd eq "font-size:incsave") {
fonts_change_size($self, $step, 2);
} elsif ($cmd eq "font-size:decsave") {
fonts_change_size($self, -$step, 2);
} elsif ($cmd eq "font-size:reset") {
fonts_reset($self);
}
}
sub on_action
{
my ($self, $action) = @_;
my $step = $self->{step};
if ($action eq "increase") {
fonts_change_size($self, $step, 0);
} elsif ($action eq "decrease") {
fonts_change_size($self, -$step, 0);
} elsif ($action eq "incglobal") {
fonts_change_size($self, $step, 1);
} elsif ($action eq "decglobal") {
fonts_change_size($self, -$step, 1);
} elsif ($action eq "incsave") {
fonts_change_size($self, $step, 2);
} elsif ($action eq "decsave") {
fonts_change_size($self, -$step, 2);
} elsif ($action eq "reset") {
fonts_reset($self);
}
}
sub fonts_change_size
{
my ($term, $change, $save) = @_;
my @newfonts = ();
my $curres = $term->resource('font');
if (!$curres) {
$term->scr_add_lines("\r\nWarning: No font configured, trying a default.\r\nPlease set a font with the 'URxvt.font' resource.");
$curres = "fixed";
}
my @curfonts = split(/\s*,\s*/, $curres);
my $basefont = shift(@curfonts);
my ($newbasefont, $newbasesize) = handle_font($term, $basefont, $change, 0);
push @newfonts, $newbasefont;
# Only adjust other fonts if base font changed
if ($newbasefont ne $basefont) {
foreach my $font (@curfonts) {
my ($newfont, $newsize) = handle_font($term, $font, $change, $newbasesize);
push @newfonts, $newfont;
}
my $newres = join(",", @newfonts);
font_apply_new($term, $newres, "font", $save);
handle_type($term, "boldFont", $change, $newbasesize, $save);
handle_type($term, "italicFont", $change, $newbasesize, $save);
handle_type($term, "boldItalicFont", $change, $newbasesize, $save);
}
if ($save > 1) {
# write the new values back to the file
my $xresources = readlink $ENV{"HOME"} . "/.Xresources";
system("xrdb -edit " . $xresources);
}
}
sub fonts_reset
{
my ($term) = @_;
foreach my $type (qw(font boldFont italicFont boldItalicFont)) {
my $initial = $term->{$type};
if ($initial ne "undef") {
font_apply_new($term, $initial, $type, 0);
}
}
}
sub handle_type
{
my ($term, $type, $change, $basesize, $save) = @_;
my $curres = $term->resource($type);
if (!$curres) {
return;
}
my @curfonts = split(/\s*,\s*/, $curres);
my @newfonts = ();
foreach my $font (@curfonts) {
my ($newfont, $newsize) = handle_font($term, $font, $change, $basesize);
push @newfonts, $newfont;
}
my $newres = join(",", @newfonts);
font_apply_new($term, $newres, $type, $save);
}
sub handle_font
{
my ($term, $font, $change, $basesize) = @_;
my $newfont;
my $newsize;
my $prefix = 0;
if ($font =~ /^\s*x:/) {
$font =~ s/^\s*x://;
$prefix = 1;
}
if ($font =~ /^\s*(\[.*\])?xft:/) {
($newfont, $newsize) = font_change_size_xft($term, $font, $change, $basesize);
} elsif ($font =~ /^\s*-/) {
($newfont, $newsize) = font_change_size_xlfd($term, $font, $change, $basesize);
} else {
# check whether the font is a valid alias and if yes resolve it to the
# actual font
my $lsfinfo = `xlsfonts -l $font 2>/dev/null`;
if ($lsfinfo eq "") {
# not a valid alias, ring the bell if it is the base font and just
# return the current font
if ($basesize == 0) {
$term->scr_bell;
}
return ($font, $basesize);
}
my $fontinfo = (split(/\n/, $lsfinfo))[-1];
my ($fontfull) = ($fontinfo =~ /\s+([-a-z0-9]+$)/);
($newfont, $newsize) = font_change_size_xlfd($term, $fontfull, $change, $basesize);
}
# $term->scr_add_lines("\r\nNew font is $newfont\n");
if ($prefix) {
$newfont = "x:$newfont";
}
return ($newfont, $newsize);
}
sub font_change_size_xft
{
my ($term, $fontstring, $change, $basesize) = @_;
my @pieces = split(/:/, $fontstring);
my @resized = ();
my $size = 0;
my $new_size = 0;
foreach my $piece (@pieces) {
if ($piece =~ /^(?:(?:pixel)?size=|[^=-]+-)(\d+(\.\d*)?)$/) {
$size = $1;
if ($basesize != 0) {
$new_size = $basesize;
} else {
$new_size = $size + $change
}
$piece =~ s/(=|-)$size/$1$new_size/;
}
push @resized, $piece;
}
my $resized_str = join(":", @resized);
# don't make fonts too small
if ($new_size >= 6) {
return ($resized_str, $new_size);
} else {
if ($basesize == 0) {
$term->scr_bell;
}
return ($fontstring, $size);
}
}
sub font_change_size_xlfd
{
my ($term, $fontstring, $change, $basesize) = @_;
#-xos4-terminus-medium-r-normal-*-12-*-*-*-*-*-*-1
my @fields = qw(foundry family weight slant setwidth style pixelSize pointSize Xresolution Yresolution spacing averageWidth registry encoding);
my %font;
$fontstring =~ s/^-//; # Strip leading - before split
@font{@fields} = split(/-/, $fontstring);
if ($font{pixelSize} eq '*') {
$term->scr_add_lines("\r\nWarning: Font size undefined, assuming 12.\r\nPlease set the 'URxvt.font' resource to a font with a concrete size.");
$font{pixelSize} = '12'
}
if ($font{registry} eq '*') {
$font{registry} ='iso8859';
}
# Blank out the size for the pattern
my %pattern = %font;
$pattern{foundry} = '*';
$pattern{setwidth} = '*';
$pattern{pixelSize} = '*';
$pattern{pointSize} = '*';
# if ($basesize != 0) {
# $pattern{Xresolution} = '*';
# $pattern{Yresolution} = '*';
# }
$pattern{averageWidth} = '*';
# make sure there are no empty fields
foreach my $field (@fields) {
$pattern{$field} = '*' unless defined($pattern{$field});
}
my $new_fontstring = '-' . join('-', @pattern{@fields});
my @possible;
# $term->scr_add_lines("\r\nPattern is $new_fontstring\n");
open(FOO, "xlsfonts -fn '$new_fontstring' | sort -u |") or die $!;
while (<FOO>) {
chomp;
s/^-//; # Strip leading '-' before split
my @fontdata = split(/-/, $_);
push @possible, [$fontdata[6], "-$_"];
# $term->scr_add_lines("\r\npossibly $fontdata[6] $_\n");
}
close(FOO);
if (!@possible) {
die "No possible fonts!";
}
if ($basesize != 0) {
# sort by font size, descending
@possible = sort {$b->[0] <=> $a->[0]} @possible;
# font is not the base font, so find the largest font that is at most
# as large as the base font. If the largest possible font is smaller
# than the base font bail and hope that a 0-size font can be found at
# the end of the function
if ($possible[0]->[0] > $basesize) {
foreach my $candidate (@possible) {
if ($candidate->[0] <= $basesize) {
return ($candidate->[1], $candidate->[0]);
}
}
}
} elsif ($change > 0) {
# sort by font size, ascending
@possible = sort {$a->[0] <=> $b->[0]} @possible;
foreach my $candidate (@possible) {
if ($candidate->[0] >= $font{pixelSize} + $change) {
return ($candidate->[1], $candidate->[0]);
}
}
} elsif ($change < 0) {
# sort by font size, descending
@possible = sort {$b->[0] <=> $a->[0]} @possible;
foreach my $candidate (@possible) {
if ($candidate->[0] <= $font{pixelSize} + $change && $candidate->[0] != 0) {
return ($candidate->[1], $candidate->[0]);
}
}
}
# no fitting font available, check whether a 0-size font can be used to
# fit the size of the base font
@possible = sort {$a->[0] <=> $b->[0]} @possible;
if ($basesize != 0 && $possible[0]->[0] == 0) {
return ($possible[0]->[1], $basesize);
} else {
# if there is absolutely no smaller/larger font that can be used
# return the current one, and beep if this is the base font
if ($basesize == 0) {
$term->scr_bell;
}
return ("-$fontstring", $font{pixelSize});
}
}
sub font_apply_new
{
my ($term, $newfont, $type, $save) = @_;
# $term->scr_add_lines("\r\nnew font is $newfont\n");
$term->cmd_parse("\033]" . $escapecodes{$type} . ";" . $newfont . "\033\\");
# load the xrdb db
# system("xrdb -load " . X_RESOURCES);
if ($save > 0) {
# merge the new values
open(XRDB_MERGE, "| xrdb -merge") || die "can't fork: $!";
local $SIG{PIPE} = sub { die "xrdb pipe broken" };
print XRDB_MERGE "URxvt." . $type . ": " . $newfont;
close(XRDB_MERGE) || die "bad xrdb: $! $?";
}
}

View File

@ -1,6 +1,6 @@
The MIT License (MIT)
Copyright (c) 2017-2021 Frieder Schlesier
Copyright (c) 2017-2022 Frieder Schlesier
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in

View File

@ -13,39 +13,35 @@
- Rescue+Recover friends laptops/computers
- panic-ops using a friends laptop
*** Firefox/Thunderbird customization
- goto ~.mozilla/firefox/<user-profile>/~
- ~mkdir chrome/ && cp ~/dotfiles/userChrome.css ./chrome/~
- open Firefox: ~about:config~ and set
~toolkit.legacyUserProfileCustomizations.stylesheets~ to *true*
*** Security
**** Hardening ssh
**** SSH Hardening
- https://blog.g3rt.nl/upgrade-your-ssh-keys.html
- https://stribika.github.io/2015/01/04/secure-secure-shell.html
- https://wiki.mozilla.org/Security/Guidelines/OpenSSH#OpenSSH_client
- see `/etc/ssh/ssh_config` and `.ssh/config`
- see ~/etc/ssh/ssh_config~ and ~.ssh/config~
add this to `~/.ssh/config`:
**** SSH key generation
#+BEGIN_SRC bash
# Ensure KnownHosts are unreadable if leaked - it is otherwise easier to know which hosts your keys have access to.
HashKnownHosts yes
# Host keys the client accepts - order here is honored by OpenSSH
HostKeyAlgorithms ssh-ed25519-cert-v01@openssh.com,ssh-rsa-cert-v01@openssh.com,ssh-ed25519,ssh-rsa,ecdsa-sha2-nistp521-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp521,ecdsa-sha2-nistp384,ecdsa-sha2-nistp256
KexAlgorithms curve25519-sha256@libssh.org,ecdh-sha2-nistp521,ecdh-sha2-nistp384,ecdh-sha2-nistp256,diffie-hellman-group-exchange-sha256
MACs hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-512,hmac-sha2-256,umac-128@openssh.com
Ciphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr
# ED25519 keys are favored over RSA keys when backward compatibility ''is not required''.
# This is only compatible with OpenSSH 6.5+ and fixed-size (256 bytes).
$ ssh-keygen -t ed25519 -f ~/.ssh/id_ed25519_host_$(date +%Y-%m-%d) -C "Key to HOST for user-xyz"
#+END_SRC
# Fallback for really old systems (why do you still have those??)
# RSA keys are favored over ECDSA keys when backward compatibility ''is required'',
# thus, newly generated keys are always either ED25519 or RSA (NOT ECDSA or DSA).
$ ssh-keygen -t rsa -b 8192 -f ~/.ssh/id_rsa_host_$(date +%Y-%m-%d) -C "Key to HOST for user-xyz"
*generating keys*
#+BEGIN_SRC bash
# RSA keys are favored over ECDSA keys when backward compatibility ''is required'',
# thus, newly generated keys are always either ED25519 or RSA (NOT ECDSA or DSA).
$ ssh-keygen -t rsa -b 8192 -f ~/.ssh/id_rsa_host_$(date +%Y-%m-%d) -C "Key to HOST for user-xyz"
# ED25519 keys are favored over RSA keys when backward compatibility ''is not required''.
# This is only compatible with OpenSSH 6.5+ and fixed-size (256 bytes).
$ ssh-keygen -t ed25519 -f ~/.ssh/id_ed25519_host_$(date +%Y-%m-%d) -C "Key to HOST for user-xyz"
$ ssh-copy-id -i ~/.ssh/<file>.pub -p 22 user@host
#+END_SRC
**** GnuPG
@ -54,9 +50,9 @@
- https://keyring.debian.org/creating-key.html
- https://wiki.debian.org/Subkeys
`~/.gnupg/gpg.conf`:
~~/.gnupg/gpg.conf~:
#+BEGIN_SRC bash
#+BEGIN_SRC bash
personal-digest-preferences SHA512 SHA384
cert-digest-algo SHA256
default-preference-list SHA512 SHA384 AES256 ZLIB BZIP2 ZIP Uncompressed
@ -88,23 +84,21 @@
Solution: multi-boot!
**** thumb drive setup
**** Thumb Drive Setup
3 partitions: boot+isos, luks encrypted, unencrypted partition for non-sensitive data
**** building kali linux iso [0/7]
- [ ] https://docs.kali.org/downloading/kali-linux-live-usb-install
- [ ] add encrypted persistence https://docs.kali.org/downloading/kali-linux-live-usb-persistence
- [ ] add kali meta packages https://www.kali.org/news/kali-linux-metapackages/
- [ ] https://docs.kali.org/development/live-build-a-custom-kali-iso
- [ ] customize live image contents https://live-team.pages.debian.net/live-manual/html/live-manual/customizing-contents.en.html#517
- [ ] add LUKS Nuke support https://www.kali.org/tutorials/nuke-kali-linux-luks/
- [ ] OPTIONAL add PowerShell https://www.kali.org/tutorials/installing-powershell-on-kali-linux/
** TODO [0/4]
** TODO [0/5]
- [ ] explain setup, ideas, practises
- [ ] add HOWTO
- [ ] seperate sources.list setup for server/desktop/laptop
- [ ] Check new bootable USB solution: https://ventoy.net/en/index.html
- [ ] move to ansible for easier modularization of setup
- [ ] OR: give GUIX a shot
** Moving to Arch
- official repository setup: https://wiki.archlinux.org/title/Official_repositories#multilib
- ~multiplib~ is required for wine
- Sound troubleshooting: https://wiki.archlinux.org/title/Advanced_Linux_Sound_Architecture/Troubleshooting#HDMI
- Skype, VSCode: use ~yay~

View File

@ -1,311 +0,0 @@
#!/usr/bin/python
# Copyright 2009 David Smith. GNU GPLv2 or, at your option, a later version.
"""Fn-F7 toggle script for xrandr.
How does it work?
First, it's stateless, so it runs xrandr -q and parses the output into a
RandRState object. The RandRState object defines attributes and methods to
query and set xrandr options.
Second, it proceeds through the state machine toggling to the next state in
order. The RandRStateMachine controls the transitions (i.e. it defines the
states).
These steps are executed by the RandRToggleCommand that parses command line
arguments, instantiates the RandRState and RandRStateMachine instances, and
handles errors.
This is one of those programs that should have existed eons ago...
"""
# ... it's a bit over engineered, I guess
__author__ = 'david.daniel.smith@gmail.com (David Smith)'
import logging
import subprocess
import re
import sys
def VecSum(*vecs):
# promise to never send me different sized vectors, ok?
size = len(vecs[0])
result = []
for i in range(0, size):
result.append(sum([vec[i] for vec in vecs]))
return result
def VecScale(scalar, vec):
return [el * scalar for el in vec]
class RandRState(object):
"""XRandR state representation."""
# TODO: implement reflections, too, someday
REFLECT_NORMAL = 'reflect_normal'
REFLECT_X = 'reflect_x'
REFLECT_Y = 'reflect_y'
REFLECT_XY = 'reflect_xy'
ROTATE_NORMAL = 'rotate_normal'
ROTATE_INVERTED = 'rotate_inverted'
ROTATE_LEFT = 'rotate_left'
ROTATE_RIGHT = 'rotate_right'
LEFT_OF = 'left_of'
RIGHT_OF = 'right_of'
ABOVE = 'above'
BELOW = 'below'
SAME_AS = 'same_as'
def __init__(self):
"""Constructor."""
self._displays = set() # the list of display names
self._connected = set() # set of connected display names
self._position = {} # display -> (x,y)
self._resolution = {} # display -> (x,y)
def _IterDisplays(self):
return iter(self._displays)
def _SetDisplays(self, displays):
self._displays = set(displays)
displays = property(_IterDisplays, _SetDisplays, None, 'display names')
def AddDisplay(self, display):
self._displays.add(display)
def RemoveDisplay(self, display):
self._displays.remove(display)
def IsConnected(self, display):
return display in self._connected
def SetConnected(self, connected):
self._connected = set(connected)
def NumConnections(self):
return len(self._connected)
def GetPosition(self, display):
result = self._position.get(display, None)
return result and tuple(result) or None
def AddConnected(self, display):
self._connected.add(display)
def RemoveConnected(self, display):
self._connected.remove(display)
def SetPosition(self, display, position):
self._position[display] = tuple(position)
def SetRelativePosition(self, display, relative_display, position):
logging.debug('setting %s %s %s' % (display, position, relative_display))
rel_pos = self.GetPosition(relative_display)
rel_res = self.GetResolution(relative_display)
dis_res = self.GetResolution(display)
if position is self.LEFT_OF:
dis_pos, rel_pos = rel_pos, VecSum((dis_res[0], rel_pos[1]),
(rel_pos[0], 0))
elif position is self.ABOVE:
dis_pos, rel_pos = rel_pos, VecSum((rel_pos[0], dis_res[1]),
(0, rel_pos[1]))
elif position is self.RIGHT_OF:
dis_pos = (rel_res[0], rel_pos[0])
elif position is self.BELOW:
dis_pos = (rel_pos[0], rel_res[1])
elif position is self.SAME_AS:
dis_pos = rel_pos
else:
raise RuntimeError('invalid position')
self.SetPosition(display, dis_pos)
self.SetPosition(relative_display, rel_pos)
def GetResolution(self, display):
result = self._resolution.get(display, None)
return result and tuple(result) or None
def SetResolution(self, display, resolution):
self._resolution[display] = tuple(resolution)
def __str__(self):
result = 'XRandR State:\n'
for display in self.displays:
connected = ['disconnected', 'connected'][self.IsConnected(display)]
geometry = ''
resolution = self.GetResolution(display)
position = self.GetPosition(display)
if resolution is not None:
geometry += '%dx%d' % resolution
if position is not None:
geometry += '+%d+%d' % position
result += ' * ' + ' '.join((display, connected, geometry)) + '\n'
return result.strip()
def Commit(self):
logging.info('Commiting %s' % self)
args = ['xrandr']
for display in self.displays:
if self.IsConnected(display):
args.extend(['--output', display,
'--pos', '%dx%d' % self.GetPosition(display),
'--mode', '%dx%d' % self.GetResolution(display)])
else:
args.extend(['--output', display, '--off'])
logging.debug('running "%s"' % ' '.join(args))
proc = subprocess.Popen(' '.join(args), stderr=subprocess.PIPE, shell=1)
if proc.wait():
error_msg = proc.stderr.read()
logging.error(error_msg)
raise RuntimeError(error_msg)
@classmethod
def ParseXRandROutput(cls, xrandr_output):
screen_re = re.compile(r'^Screen')
display_re = re.compile(r'^(?P<name>\S+)\s+((?P<disconnected>dis))?'
+ r'connected\s+((?P<res_x>\d+)x(?P<res_y>\d+)'
+ r'\+(?P<pos_x>\d+)\+(?P<pos_y>\d+))?')
mode_re = re.compile(r'^\s+(?P<res_x>\d+)x(?P<res_y>\d+)\s+\d+')
state = cls()
line = xrandr_output.readline()
while line:
# look for a display line
match = display_re.search(line)
if not match:
line = xrandr_output.readline()
continue
# parse out the name and connection status
display = match.group('name')
connected = not bool(match.group('disconnected'))
logging.debug('Found %s display %s' %
(['disconnected', 'connected'][connected],
display))
state.AddDisplay(display)
res = tuple((int(match.group(x) or 0) for x in ('res_x', 'res_y')))
pos = tuple((int(match.group(x) or 0) for x in ('pos_x', 'pos_y')))
if connected and res != (0, 0):
state.AddConnected(display)
state.SetResolution(display, res)
state.SetPosition(display, pos)
# skip until the next display line
line = xrandr_output.readline()
while line and not display_re.search(line):
line = xrandr_output.readline()
# else, look for a mode line and set the res to that
else:
while True:
line = xrandr_output.readline()
match = mode_re.match(line)
# if no mode lines, give up
if not match:
break
res = tuple((int(match.group(x)) for x in ('res_x', 'res_y')))
state.AddConnected(display)
state.SetResolution(display, res)
state.SetPosition(display, (0, 0))
# only need one so might as well end the loop here
break
logging.debug('Parsed %s' % state)
return state
class RandRStateMachine(object):
"""State manipulator."""
def __init__(self, state):
"""Constructor."""
self._state = state
def GetCurrentState(self):
return self._state
def NextState(self):
# if we have a clone, then next pair to the left
if self.IsClone():
logging.info('CLONE -> PAIR_RIGHT')
self.SetPairExtRight()
# if we have a pair to the left, then next pair to the right
elif self.IsPairExtRight():
logging.info('PAIR_RIGHT -> PAIR_LEFT')
self.SetPairExtLeft()
# else, just set cloning
else:
logging.info('UNKNOWN (or PAIR_RIGHT) -> CLONE')
self.SetClone()
def IsClone(self):
found_origin_count = 0
for disp in self._state.displays:
if not self._state.IsConnected(disp):
continue
if self._state.GetPosition(disp) == (0, 0):
found_origin_count += 1
return found_origin_count >= 2
def SetClone(self):
for disp in self._state.displays:
logging.info('Cloning display %s' % disp)
if not self._state.IsConnected(disp):
logging.info('Skipping disconnected display %s' % disp)
continue
self._state.SetPosition(disp, (0, 0))
self._state.Commit()
def _IsPairCmp(self):
if self._state.NumConnections() < 2:
return 0
for disp in self._state.displays:
if not self._state.IsConnected(disp):
continue
if disp.startswith('LVDS'):
if self._state.GetPosition(disp) == (0, 0):
return 1
else:
return -1
return 0
def IsPairExtLeft(self):
return self._IsPairCmp() < 0
def IsPairExtRight(self):
return self._IsPairCmp() > 0
def _SetPairExt(self, direction):
lvds = ''
ext = ''
for disp in self._state.displays:
if not self._state.IsConnected(disp):
continue
if disp.startswith('LVDS'):
lvds = disp
else:
ext = disp
self._state.SetRelativePosition(ext, lvds, direction)
self._state.Commit()
def SetPairExtLeft(self):
self._SetPairExt(self._state.LEFT_OF)
def SetPairExtRight(self):
for disp in self._state.displays:
if disp.startswith('LVDS'):
self._state.SetPosition(disp, (0, 0))
self._state.Commit()
self._SetPairExt(self._state.RIGHT_OF)
def main():
logging.basicConfig(stream=sys.stdout, level=logging.DEBUG)
xrandr = subprocess.Popen('xrandr -q', stdout=subprocess.PIPE, shell=True)
xrandr.wait()
state = RandRState.ParseXRandROutput(xrandr.stdout)
sm = RandRStateMachine(state)
sm.NextState()
if __name__ == '__main__':
main()

View File

@ -0,0 +1,10 @@
[Unit]
Description=My auto backup to WD Passport
Requires=media-wdpassport2tb.mount
After=media-wdpassport2tb.mount
[Service]
ExecStart=/home/fschl/dotfiles/scripts/show_local_backup.sh
[Install]
WantedBy=media-wdpassport2tb.mount

View File

@ -0,0 +1,11 @@
[Unit]
Description=Restart Syncthing after resume
Documentation=man:syncthing(1)
After=sleep.target
[Service]
Type=oneshot
ExecStart=-/usr/bin/pkill -HUP -x syncthing
[Install]
WantedBy=sleep.target

View File

@ -0,0 +1,24 @@
[Unit]
Description=Syncthing - Open Source Continuous File Synchronization for %I
Documentation=man:syncthing(1)
After=network.target
StartLimitIntervalSec=60
StartLimitBurst=4
[Service]
User=%i
ExecStart=/usr/bin/syncthing serve --no-browser --no-restart --logflags=0
Restart=on-failure
RestartSec=1
SuccessExitStatus=3 4
RestartForceExitStatus=3 4
# Hardening
ProtectSystem=full
PrivateTmp=true
SystemCallArchitectures=native
MemoryDenyWriteExecute=true
NoNewPrivileges=true
[Install]
WantedBy=multi-user.target

14
restic-cheatsheet.org Normal file
View File

@ -0,0 +1,14 @@
* Restic - backups
https://restic.readthedocs.io/en/stable/
- init repo :: ~restic init --repo <path>~
- backup :: ~restic -r <path> --verbose backup <path>~
- restore :: ~restic -r <path> restore <ID/latest> --target /tmp/restore-work~
- restore latest via path :: ~restic -r <path> restore latest --path "somepath"~
- list snapshots :: ~restic -r <path> snapshots~
- copy snapshots between repos :: with filtering
#+begin_src bash
restic -r <sourcerepo> copy --repo2 <targetrepo> --path <path> <ID/latest>
#+end_src

View File

@ -5,7 +5,7 @@ set -x
# backup.sh
pre="/home/fschl"
target="/media/black_Backups/2018-12"
target="/media/store/"
# target="/media/driveBay/Backups"
folders=( "Documents" #contains Org files
@ -59,4 +59,4 @@ main() {
esac
}
main "$@" 2>&1 | tee "${pre}/backup_$(date +%Y-%M-%d_%H-%M)_$1.log"
main "$@" 2>&1 | tee "${pre}/backup_$(date +%Y-%m-%d_%H-%M)_$1.log"

View File

@ -2,7 +2,7 @@
set -e
# install.sh
# This script installs my basic setup for a debian machine
# This script installs a basic setup for a debian machine
USERNAME=fschl
SUDO="sudo"
@ -20,7 +20,7 @@ check_root() {
}
apt_sources() {
# http://deb.debian.org/
# https://www.debian.org/releases/
ddist=$1
DIST="${ddist:-stable}"
@ -61,6 +61,7 @@ base_applications() {
apt-transport-https \
automake \
bash-completion \
bat \
bmon \
bzip2 \
ca-certificates \
@ -69,6 +70,7 @@ base_applications() {
cryptsetup \
curl \
dnsutils \
fzf \
gcc \
git \
gnupg \
@ -82,6 +84,8 @@ base_applications() {
make \
mount \
net-tools \
restic \
ripgrep \
rsync \
ssh \
sudo \
@ -98,12 +102,11 @@ base_applications() {
zip \
--no-install-recommends
$SUDO restic self-update
echo "... DONE... cleaning up\n\n"
$SUDO apt autoremove
$SUDO apt autoclean
$SUDO apt clean
$SUDO ip link add dev wg0 type wireguard
}
install_server_base() {
@ -111,17 +114,17 @@ install_server_base() {
DEBIAN_FRONTEND=noninteractive
apt update
apt install -y \
$SUDO apt update
$SUDO apt install -y \
fail2ban \
logwatch \
unattended-upgrades \
--no-install-recommends
echo "... DONE... cleaning up\n\n"
apt autoremove
apt autoclean
apt clean
$SUDO apt autoremove
$SUDO apt autoclean
$SUDO apt clean
echo "setting up logwatch..."
echo "... TODO require email to be set as parameter"
@ -139,10 +142,9 @@ APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Download-Upgradeable-Packages "1";
APT::Periodic::AutocleanInterval "7";
APT::Periodic::Unattended-Upgrade "1";
EOF
echo " ... DONE"
echo " ... DONE"
}
no_suspend() {
@ -172,9 +174,8 @@ install_nvidia_docker() {
}
install_latex() {
apt update
apt install -y \
$SUDO apt update
$SUDO apt install -y \
evince \
texlive \
texlive-bibtex-extra \
@ -190,32 +191,18 @@ install_latex() {
--no-install-recommends
}
install_i3() {
echo "update and installing i3wm and some tools..."
# check if CJK and other eastern letters are displayed correctly:
# https://meta.wikimedia.org/wiki/List_of_Wikipedias
# tlp: Advanced Linux Power Management
# http://linrunner.de/en/tlp/docs/tlp-linux-advanced-power-management.html
# deb http://repo.linrunner.de/debian sid main
# add the tlp apt-repo gpg key
# apt-key adv --keyserver pool.sks-keyservers.net --recv-keys CD4E8809
install_workstation_apps() {
DEBIAN_FRONTEND=noninteractive
# TODO add non-free to apt/sources.list
apt update
apt install -y \
$SUDO apt update
$SUDO apt install -y \
alsa-tools \
alsa-utils \
aspell \
aspell-de \
aspell-en \
cups-browsed \
emacs \
feh \
firefox-esr \
firmware-iwlwifi \
firmware-linux-nonfree \
@ -223,12 +210,8 @@ install_i3() {
fonts-font-awesome \
fonts-noto \
fonts-noto-cjk \
fswebcam \
fonts-powerline \
gimp \
i3 \
i3lock \
i3lock-fancy \
i3status \
keepassxc \
libnotify-bin \
libnotify-dev \
@ -237,59 +220,162 @@ install_i3() {
libreoffice-l10n-de \
libreoffice-l10n-en-gb \
libreoffice-writer \
network-manager-gnome \
network-manager-vpnc \
network-manager-vpnc-gnome \
notify-osd \
ntfs-3g \
network-manager \
network-manager-openvpn \
nmap \
pulseaudio \
remmina \
rxvt-unicode-256color \
scrot \
shotwell \
slim \
openvpn \
openvpn-systemd-resolved \
thunderbird \
thunderbird-l10n-de \
thunderbird-l10n-en-gb \
--no-install-recommends
TARGET="/home/$USERNAME/.emacs.d"
rm -rf ${TARGET}
git clone https://github.com/syl20bnr/spacemacs "${TARGET}"
# rm -rf "${TARGET}"/private/snippets
# git clone https://github.com/AndreaCrotti/yasnippet-snippets "${TARGET}"/private/yas-snippets
# ln -s "${TARGET}"/private/yas-snips/snippets "${TARGET}"/private/snippets/
}
install_sway() {
echo " installing sway and wayland tools..."
DEBIAN_FRONTEND=noninteractive
$SUDO apt update
$SUDO apt install -y \
brightnessctl \
mako \
sway \
udiskie \
udisks2 \
wl-clipboard \
wob \
wofi \
ydotool \
--no-install-recommends
mv /home/${USERNAME}/.bashrc /home/${USERNAME}/.bashrc~
ln -s /home/${USERNAME}/dotfiles/.bashrc /home/${USERNAME}/.bashrc
cp ../sway/mako.conf /home/${USERNAME}/.config/mako/conf
(
git clone https://github.com/Biont/sway-launcher-desktop /home/${USERNAME}/projects/sway-launcher-desktop
)
# build swaylock-effects because its not available on Debian
# https://github.com/voidgloom/swaylock-effects
(
$SUDO apt update
$SUDO apt install -y \
wayland-protocols \
libwayland-client++0 \
libcairo2-dev \
libwayland-client0 \
--no-install-recommends
TARGET=/home/${USERNAME}/projects/swaylock-effects
git clone https://github.com/voidgloom/swaylock-effects ${TARGET}
cd ${TARGET}
meson build && ninja -C build && sudo ninja -C build install
$SUDO chmod a+s /usr/local/bin/swaylock
)
}
install_i3() {
echo "Xorg with i3wm and some tools..."
# check if CJK and other eastern letters are displayed correctly:
# https://meta.wikimedia.org/wiki/List_of_Wikipedias
DEBIAN_FRONTEND=noninteractive
$SUDO apt update
$SUDO apt install -y \
feh \
fswebcam \
i3 \
i3lock \
i3lock-fancy \
i3status \
lightdm \
network-manager-gnome \
network-manager-vpnc \
network-manager-vpnc-gnome \
remmina \
rxvt-unicode \
scrot \
shotwell \
suckless-tools \
vlc \
xdotool \
xorg \
--no-install-recommends
cat <<-EOF > /usr/share/dbus-1/services/org.freedesktop.Notifications.service
[D-BUS Service]
Name=org.freedesktop.Notifications
Exec=/usr/lib/notification-daemon/notification-daemon
EOF
# for f in (); do
# ln -s $f /home/$USER/$f
# done
echo "... setting capslock to control"
$SUDO sed -i "s/^XKBOPTIONS=.*/XKBOPTIONS=\"ctrl:nocaps\"/" /etc/default/keyboard
}
install_syncthing() {
# install Syncthing via https://apt.syncthing.net/
# Add the release PGP keys:
curl -s https://syncthing.net/release-key.txt | sudo apt-key add -
# Add the "stable" channel to your APT sources:
echo "deb https://apt.syncthing.net/ syncthing stable" | sudo tee /etc/apt/sources.list.d/syncthing.list
cat "deb https://apt.syncthing.net/ syncthing stable" | sudo tee /etc/apt/sources.list.d/syncthing.list
# pin the correct apt repo
printf "Package: *\nPin: origin apt.syncthing.net\nPin-Priority: 990\n" | sudo tee /etc/apt/preferences.d/syncthing
# Update and install syncthing:
sudo apt-get update
sudo apt-get install syncthing
$SUDO apt-get update
$SUDO apt-get install -y syncthing
echo "... DONE... cleaning up\n\n"
apt autoremove
apt autoclean
apt clean
$SUDO apt autoremove
$SUDO apt autoclean
$SUDO apt clean
TARGET="/home/$USERNAME/.emacs.d"
git clone https://github.com/syl20bnr/spacemacs "${TARGET}"
# rm -rf "${TARGET}"/private/snippets
# git clone https://github.com/AndreaCrotti/yasnippet-snippets "${TARGET}"/private/yas-snippets
# ln -s "${TARGET}"/private/yas-snips/snippets "${TARGET}"/private/snippets/
echo "enable and start the syncthing per-user service for ${USERNAME}"
$SUDO cp ../etc/systemd/system/syncth* /etc/systemd/system/
user=${USERNAME}
$SUDO systemctl daemon-reload
$SUDO systemctl enable syncthing@${USERNAME}
$SUDO systemctl start syncthing@${USERNAME}.service
systemctl status syncthing@${USERNAME}.service
no_suspend
echo "... setting capslock to control"
sed -i "s/^XKBOPTIONS=.*/XKBOPTIONS=\"ctrl:nocaps\"/" /etc/default/keyboard
TARGET="/home/$USERNAME/.emacs.d"
git clone https://github.com/syl20bnr/spacemacs "${TARGET}"
#rm -rf "${TARGET}"/private/snippets
#git clone https://github.com/AndreaCrotti/yasnippet-snippets "${TARGET}"/private/yas-snips
#ln -s "${TARGET}"/private/yas-snips/snippets "${TARGET}"/private/snippets/
}
link_userdirs() {
mount_dir=$1
target_mount="${mount_dir:-/mnt/docs/}"
user_dirs=("Documents Downloads Music Pictures Videos")
for DIR in $user_dirs
do
echo "removing and linking ${DIR}..."
rm -rfv /home/$USERNAME/$DIR
echo "link target: ${target_mount}/${DIR}"
ln -vs ${target_mount}/${DIR} /home/${USERNAME}/${DIR}
done
projects_mount=$docs_mount
}
install_vscodium() {
@ -299,8 +385,8 @@ install_vscodium() {
echo 'deb https://gitlab.com/paulcarroty/vscodium-deb-rpm-repo/raw/repos/debs/ vscodium main' | sudo tee --append /etc/apt/sources.list.d/vscodium.list
apt update
apt install -y \
$SUDO apt update
$SUDO apt install -y \
codium \
--no-install-recommends
@ -311,6 +397,22 @@ install_vscodium() {
# vscodevim.vim
}
install_wine() {
# https://wiki.winehq.org/Debian
curl https://dl.winehq.org/wine-builds/winehq.key | gpg --dearmor > /etc/apt/trusted.gpg.d/winehq.gpg
echo 'deb https://dl.winehq.org/wine-builds/debian/ bookworm main' | sudo tee /etc/apt/sources.list.d/wine.list
$SUDO sudo dpkg --add-architecture i386
$SUDO apt update
$SUDO apt install \
winehq-staging \
--install-recommends
wine --version
}
install_docker() {
# https://docs.docker.com/install/linux/docker-ce/debian/#install-using-the-repository
@ -319,7 +421,7 @@ install_docker() {
echo "installing docker binary Version $VERS ..."
# https://github.com/tianon/cgroupfs-mount/blob/master/cgroupfs-mount
apt install -y \
$SUDO apt install -y \
apt-transport-https \
ca-certificates \
curl \
@ -336,12 +438,12 @@ install_docker() {
# deb [arch=amd64] https://download.docker.com/linux/debian buster nightly
EOF
apt update
apt install -y \
$SUDO apt update
$SUDO apt install -y \
docker-ce \
--no-install-recommends
addgroup ${USERNAME} docker
$SUDO usermod -aG docker ${USERNAME}
docker version
docker info
@ -351,12 +453,11 @@ install_compose() {
# https://github.com/docker/compose/releases
# btw: *not* for raspbian! you got 3 choices: hypriot, install via pip or build yourself
# https://www.berthon.eu/2017/getting-docker-compose-on-raspberry-pi-arm-the-easy-way/
VERS="1.28.6"
VERS="1.29.2"
FILE="docker-compose-$(uname -s)-$(uname -m)"
echo "installing docker-compose $VERS ... curling from github"
curl -SL "https://github.com/docker/compose/releases/download/${VERS}/${FILE}" -o /tmp/${FILE}
curl -SL "https://github.com/docker/compose/releases/download/${VERS}/${FILE}.sha256" -o /tmp/${FILE}.sha256
if [ ! $(cat /tmp/${FILE}.sha256 | sha256sum -c -) ]; then
@ -373,9 +474,52 @@ install_compose() {
/usr/bin/docker-compose version
}
install_nvidia() {
echo "Prepare install for NVIDIA proprietary display driver"
apt update
apt install -y \
gcc \
linux-source \
linux-headers-`uname -r` \
--no-install-recommends
echo ""
echo "Please find a link to the current Package"
echo " https://devtalk.nvidia.com/default/topic/533434/linux/current-graphics-driver-releases/"
echo ""
echo "1. Download the self extracting archive. (*.run)"
echo "2. reboot into recovery mode and login as root"
echo "3. sh DRIVER_ARCHIVE.run"
echo ""
echo "... check if driver was installed correctly: $ nvidia-smi"
echo "more information can be found in README at link above"
echo ""
echo "Install NVIDIA-docker"
echo ""
echo "since Docker 19.03 no additional runtime required."
echo " https://github.com/NVIDIA/nvidia-docker"
# https://nvidia.github.io/nvidia-docker/
distribution="debian10"
curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add -
curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | sudo tee /etc/apt/sources.list.d/nvidia-docker.list
apt update
apt install -y nvidia-container-toolkit
systemctl restart docker
docker pull nvidia/cuda:9.0-base
echo ""
echo "... check if driver was installed correctly: "
echo "$ docker run --gpus all nvidia/cuda:9.0-base nvidia-smi"
echo " should give same output as above"
}
install_virtualbox() {
# https://wiki.debian.org/VirtualBox#Installation_of_non-free_edition
apt install -y \
$SUDO apt install -y \
apt-transport-https \
ca-certificates \
curl \
@ -383,22 +527,20 @@ install_virtualbox() {
software-properties-common \
--no-install-recommends
}
curl -fsSL https://download.docker.com/linux/debian/gpg | $SUDO apt-key add -
get_dotfiles() {
# add docker apt repo
cat <<-EOF > /etc/apt/sources.list.d/docker.list
deb [arch=amd64] https://download.docker.com/linux/debian buster stable
# deb [arch=amd64] https://download.docker.com/linux/debian buster test
# deb [arch=amd64] https://download.docker.com/linux/debian buster nightly
EOF
(
# git clone https://gitlab.com/fschl/dotfiles.git "/home/$USERNAME/dotfiles"
# cd "/home/$USERNAME/dotfiles" && make
# TODO: propbably dont really need the whole repo
git clone https://gitlab.com/fschl/dockerfiles.git "/home/$USERNAME/dockerfiles"
)
}
# install/update golang from source
install_golang() {
export GO_VERSION=1.16.0
export GO_VERSION=1.18
export GO_SRC=/usr/local/go
# if we are passing the version
@ -406,41 +548,75 @@ install_golang() {
export GO_VERSION=$1
fi
# subshell because we `cd`
(
curl -sSL "https://storage.googleapis.com/golang/go${GO_VERSION}.linux-amd64.tar.gz" | $SUDO tar -v -C /usr/local -xz
)
}
install_rust() {
echo "... rustup.sh ... "
curl --proto 'https' --tlsv1.2 https://sh.rustup.rs | sh
echo "... adding dependencies for alacritty and i3status-rs ... "
$SUDO apt install -y \
cmake \
fonts-font-awesome \
gcc \
pkg-config \
libdbus-1-dev \
libfreetype6-dev \
libfontconfig1-dev \
libssl-dev \
libxcb-xfixes0-dev \
libxkbcommon-dev \
python3 \
--no-install-recommends
cargo install du-dust
(
mkdir -p "/home/$USERNAME/projects"
TARGET="/home/$USERNAME/projects/i3status-rust"
git clone https://github.com/greshake/i3status-rust ${TARGET}
cd ${TARGET}
cargo install --path .
./install.sh
)
}
main() {
local cmd=$1
if [[ -z "$cmd" ]]; then
echo "Usage: \n base (includes docker+compose)| desktop | server | dotfiles | vscode | latex | update-docker | go"
echo "Usage: \n base (incl docker+compose)| i3 | sway | server | latex | update-docker | vscode | go | rust"
fi
case "$cmd" in
base)
# apt_sources buster
base_applications
install_docker
install_compose
;;
dotfiles)
get_dotfiles
;;
server)
install_server_base
;;
desktop)
# apt_sources buster
base_applications
install_server_base
install_docker
install_compose
;;
i3)
base_applications
install_syncthing
install_i3
if [ -f "./get_private_stuff.sh" ]; then
source get_private_stuff.sh
fi
install_workstation_apps
;;
sway)
base_applications
install_syncthing
install_sway
install_workstation_apps
;;
links)
link_userdirs /mnt/docs/
;;
latex)
install_latex
@ -455,6 +631,12 @@ main() {
go)
install_golang
;;
rust)
install_rust
;;
wine)
install_wine
;;
esac
}

328
scripts/install_arch.sh Executable file
View File

@ -0,0 +1,328 @@
#!/bin/bash
set -e
# install.sh
# This script installs a basic setup for a debian machine
USERNAME=fschl
SUDO="sudo"
check_root() {
# We need root rights at some point
if [ "$(whoami)" != "root" ]; then
if ! which $SUDO >/dev/null; then
echo "ERROR: $0 is not run as root and $SUDO is not available" >&2
exit 1
fi
else
SUDO="" # We're already root
fi
}
base_applications() {
echo "update and installing baseapps..."
$SUDO pacman -Syu \
bash-completion \
bmon \
bzip2 \
ca-certificates \
cmake \
coreutils \
cryptsetup \
curl \
dhclient \
dnsutils \
gcc \
git \
gnupg \
htop \
make \
mount \
net-tools \
networkmanager \
pacman-contrib \
rsync \
openssh \
sudo \
tar \
tmux \
tree \
unzip \
vim \
vpnc \
wireguard-tools \
zip
echo "... DONE... cleaning up\n\n"
# $SUDO ip link add dev wg0 type wireguard
$SUDO systemctl start NetworkManager.service
$SUDO systemctl enable NetworkManager.service
}
no_suspend() {
# https://wiki.debian.org/SystemdSuspendSedation
$SUDO sed -i "s/HandleLidSwitch=.*/HandleLidSwitch=ignore/" /etc/systemd/logind.conf
$SUDO sed -i "s/HandleLidSwitchDocked=.*/HandleLidSwitchDocked=ignore/" /etc/systemd/logind.conf
$SUDO sed -i "s/IdleActionSec=.*/IdleActionSec=90min/" /etc/systemd/logind.conf
# turn off screen blanking
# https://www.raspberrypi.org/forums/viewtopic.php?f=66&t=18200&sid=135af53eb82496bc64f4c0eefbc86d2c&start=25
# http://raspberrypi.stackexchange.com/questions/752/how-do-i-prevent-the-screen-from-going-blank
xset s noblank
$SUDO systemctl restart systemd-logind.service
}
install_nvidia_docker() {
# get latest driver from https://www.nvidia.com/object/unix.html
# https://github.com/NVIDIA/nvidia-docker/wiki/Installation-(version-2.0)#prerequisites
curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | \
sudo tee /etc/apt/sources.list.d/nvidia-docker.list
sudo apt-get update
# Install nvidia-docker2 and reload the Docker daemon configuration
sudo apt-get install -y nvidia-docker2
sudo pkill -SIGHUP dockerd
}
install_latex() {
echo "- installing LaTeX.."
pacman -Syu \
evince \
texlive \
texlive-bibtex-extra \
texlive-fonts-extra \
texlive-fonts-recommended \
texlive-lang-english \
texlive-lang-german \
texlive-latex-extra \
texlive-latex-recommended \
texlive-pictures \
texlive-plain-generic
echo "..done"
}
install_i3() {
echo "- installing i3wm and some tools..."
# check if CJK and other eastern letters are displayed correctly:
# https://meta.wikimedia.org/wiki/List_of_Wikipedias
# tlp: Advanced Linux Power Management
# http://linrunner.de/en/tlp/docs/tlp-linux-advanced-power-management.html
# deb http://repo.linrunner.de/debian sid main
$SUDO pacman -Syu \
alsa-utils \
arandr \
aspell \
aspell-de \
aspell-en \
emacs \
feh \
firefox \
gimp \
i3 \
i3lock \
i3lock-fancy \
i3status \
keepassxc \
libreoffice-fresh \
libreoffice-fresh-de \
libreoffice-fresh-en-gb \
lightdm \
obs-studio \
openvpn \
powerline-fonts \
pulseaudio \
pulseaudio-alsa \
pulsemixer \
rxvt-unicode \
scrot \
shotwell \
speedcrunch \
thunderbird \
thunderbird-l10n-de \
thunderbird-l10n-en-gb \
ttf-font-awesome \
ttf-dejavu \
ttf-opensans \
udiskie \
vlc \
xorg \
xorg-xrandr \
noto-fonts \
syncthing
$SUDO localectl set-x11-keymap de,de ctrl:nocaps
# cups-browsed \
# feh \
# firmware-linux-nonfree \
# firmware-realtek \
# fswebcam \
# libnotify-bin \
# libnotify-dev \
# network-manager-gnome \
# network-manager-vpnc \
# network-manager-vpnc-gnome \
# notify-osd \
# ntfs-3g \
# nmap \
# pulseaudio \
# remmina \
# rxvt-unicode-256color \
# slim \
# --no-install-recommends
# cat <<-EOF > /usr/share/dbus-1/services/org.freedesktop.Notifications.service
# [D-BUS Service]
# Name=org.freedesktop.Notifications
# Exec=/usr/lib/notification-daemon/notification-daemon
# EOF
TARGET="/home/$USERNAME/.emacs.d"
git clone https://github.com/syl20bnr/spacemacs "${TARGET}"
# rm -rf "${TARGET}"/private/snippets
# git clone https://github.com/AndreaCrotti/yasnippet-snippets "${TARGET}"/private/yas-snippets
# ln -s "${TARGET}"/private/yas-snips/snippets "${TARGET}"/private/snippets/
no_suspend
echo "... setting capslock to control"
sed -i "s/^XKBOPTIONS=.*/XKBOPTIONS=\"ctrl:nocaps\"/" /etc/default/keyboard
TARGET="/home/$USERNAME/.emacs.d"
git clone https://github.com/syl20bnr/spacemacs "${TARGET}"
#rm -rf "${TARGET}"/private/snippets
#git clone https://github.com/AndreaCrotti/yasnippet-snippets "${TARGET}"/private/yas-snips
#ln -s "${TARGET}"/private/yas-snips/snippets "${TARGET}"/private/snippets/
}
link_userdirs() {
mount_dir=$1
target_mount="${mount_dir:-/mnt/docs/}"
user_dirs=("Documents Downloads Music Pictures Videos")
for DIR in $user_dirs
do
echo "removing and linking ${DIR}..."
rm -rfv /home/$USERNAME/$DIR
echo "link target: ${target_mount}/${DIR}"
ln -vs ${target_mount}/${DIR} /home/${USERNAME}/${DIR}
done
projects_mount=$docs_mount
}
install_wine() {
# edit /etc/pacman.conf
# TODO: enable multilib + Include mirrorlist
# if using NVidia gpu
$SUDO pacman -Syu \
lib32-alsa-plugins \
lib32-libpulse \
lib32-nvidia-utils \
lib32-openal \
multilib \
wine
}
install_vscodium() {
# https://vscodium.com/
pacman -Syu \
codium \
--no-install-recommends
codium version
}
install_docker() {
echo "installing docker binary Version $VERS ..."
# https://github.com/tianon/cgroupfs-mount/blob/master/cgroupfs-mount
pacman -Syu \
docker \
docker-compose
$SUDO usermod -aG docker $USERNAME
docker version
docker info
}
install_nvidia() {
echo "Prepare install for NVIDIA proprietary display driver"
pacman -Syu \
nvidia
}
install_virtualbox() {
# https://wiki.debian.org/VirtualBox#Installation_of_non-free_edition
pacman -Syu \
apt-transport-https \
ca-certificates \
curl \
gnupg2 \
software-properties-common \
--no-install-recommends
}
main() {
local cmd=$1
if [[ -z "$cmd" ]]; then
echo "Usage: \n base (includes docker+compose)| desktop | server | dotfiles | vscode | latex | update-docker | go"
fi
case "$cmd" in
base)
# apt_sources buster
base_applications
;;
server)
base_applications
install_server_base
install_docker
install_compose
;;
desktop)
base_applications
install_docker
install_compose
install_i3
if [ -f "./get_private_stuff.sh" ]; then
source get_private_stuff.sh
fi
;;
links)
link_userdirs /mnt/docs/
;;
latex)
install_latex
;;
vscode)
install_vscodium
;;
update-docker)
install_docker
install_compose
;;
go)
install_golang
;;
esac
}
main "$@"

79
sway/.bashrc Executable file
View File

@ -0,0 +1,79 @@
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
# don't put duplicate lines or lines starting with space in the history.
# See bash(1) for more options
HISTCONTROL=ignoreboth
# Load the shell dotfiles, and then some:
# * ~/.path can be used to extend `$PATH`.
# * ~/.extra can be used for other settings you dont want to commit.
for file in ~/.{aliases,bash_prompt,functions,path,extra,exports}; do
[[ -r "$file" ]] && [[ -f "$file" ]] && source "$file"
done
unset file
# Case-insensitive globbing (used in pathname expansion)
shopt -s nocaseglob
# append to the history file, don't overwrite it
shopt -s histappend
# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=1000000
HISTFILESIZE=20000000
export TERMINAL="alacritty";
export TERM="alacritty";
# 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
# make less more friendly for non-text input files, see lesspipe(1)
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
# 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
PS1="\[\e[01;36m\]\u\[\e[0m\]\[\e[00;37m\]@\[\e[0m\]\[\e[01;33m\]\h\[\e[0m\]\[\e[00;36m\][\w]\[\e[0m\]\[\e[01;31m\]\n\\$\[\e[0m\]\[\e[00;37m\] \[\e[0m\]"
# If this is an xterm set the title to user@host:dir
PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
alias ls='ls --color=auto'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
fi
# Add an "alert" alias for long running commands. Use like so:
# sleep 10; alert
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'
# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
if ! shopt -oq posix; then
if [ -f /usr/share/bash-completion/bash_completion ]; then
. /usr/share/bash-completion/bash_completion
elif [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
fi

2
sway/.exports Normal file
View File

@ -0,0 +1,2 @@
export MOZ_ENABLE_WAYLAND=1
export QT_QPA_PLATFORM=wayland

295
sway/config Executable file
View File

@ -0,0 +1,295 @@
# Default config for sway
#
# Copy this to ~/.config/sway/config and edit it to your liking.
#
# Read `man 5 sway` for a complete reference.
# Logo key. Use Mod1 for Alt.
set $mod Mod4
font pango:DejaVu Sans Mono 8
set $term alacritty
# Use Mouse+$mod to drag floating windows to their wanted position
floating_modifier $mod
hide_edge_borders both # none|vertical|horizontal|both
output * bg /usr/share/backgrounds/sway/Sway_Wallpaper_Blue_1920x1080.png fill
# start a terminal
bindsym $mod+Return exec alacritty
# kill focused window
bindsym $mod+Shift+q kill
# start dmenu (a program launcher)
# for_window [app_id="^launcher$"] floating enable, sticky enable, resize set 30 ppt 60 ppt, border pixel 10
# set $menu exec $term --class=launcher -e /home/fschl/projects/sway-launcher-desktop/sway-launcher-desktop.sh
# bindsym $mod+d exec $menu
bindsym $mod+d exec wofi --show=drun --lines=10 --prompt=""
# bindsym Ctrl+Shift+l exec i3lock-fancy
bindsym Ctrl+Shift+l exec swaylock \
--screenshots \
--clock \
--indicator \
--indicator-radius 100 \
--indicator-thickness 7 \
--effect-blur 7x9 \
--effect-vignette 0.5:0.5 \
--ring-color 859900 \
--key-hl-color 2aa198 \
--line-color 00000000 \
--inside-color 00000088 \
--separator-color 00000000 \
--grace 2 \
--fade-in 0.2
input * {
xkb_layout "de"
xkb_variant "nodeadkeys"
xkb_options "ctrl:nocaps"
}
# change focus
bindsym $mod+j focus left
bindsym $mod+k focus down
bindsym $mod+l focus right
# alternatively, you can use the cursor keys:
bindsym $mod+Left focus left
bindsym $mod+Down focus down
bindsym $mod+Right focus right
# move focused window
bindsym $mod+Shift+j move left
bindsym $mod+Shift+k move down
bindsym $mod+Shift+l move right
# alternatively, you can use the cursor keys:
bindsym $mod+Shift+Left move left
bindsym $mod+Shift+Down move down
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
# 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
# float some applications
for_window [class="Tor Browser"] floating enable
bindsym $mod+a focus parent # focus the parent container
# manage workspaces
# look for icons: https://fontawesome.com/icons?d=gallery
# firefox - browser is placed on this Workspace
set $WS1 "1 "
# git - emacs <3
set $WS2 "2 "
# terminal - place for urxvt
set $WS3 "3 "
# envelope - thunderbird windows on here
set $WS4 "4 "
# code - eclise, intellij IDEs, etc
set $WS5 "5 "
# unlock-alt - keepassxc defaults here
set $WS8 "8 "
# linux - less often used terminals for background processes
set $WS9 "9 "
assign [class="^Firefox$"] $WS1
assign [class="^Eclipse$"] $WS5
assign [class="^Thunderbird$"] $WS4
assign [class=".*ee.*ass.*"] $WS8
# https://faq.i3wm.org/question/3726/workspace-output-multiple-values/index.html%3Fanswer=3731.html#post-id-3731
set $LAPTOP LVDS-1
# set $EXTERN HDMI-1
set $EXTERN VGA-1
# monitor settings
bindsym $mod+m mode "monitor"
mode "monitor" {
# only laptop
# bindsym 1 exec xrandr --output $LAPTOP --auto --primary --output $CENTER --off $RIGHT --off
# HDMI main, laptop secondary
# bindsym 2 exec xrandr --output $CENTER --primary --auto --output $LAPTOP --auto --left-of $CENTER --output $RIGHT --off
# HDMI main, laptop left, VGA right, *not* supported on X230
# bindsym 3 exec xrandr --output $CENTER --primary --auto --output $LAPTOP --auto --left-of $CENTER --output $RIGHT --auto --right-of $CENTER
# HDMI main, VGA right, laptop off
# bindsym 4 exec xrandr --output $CENTER --primary --auto --output $RIGHT --right-of $CENTER --rotate left --auto --output $LAPTOP --off
# VGA main, laptop left, HDMI off
# bindsym 8 exec xrandr --output $RIGHT --primary --auto --output $LAPTOP --auto --left-of $RIGHT --output $CENTER --off
# HDMI main, VGA right, laptop off
# bindsym 9 exec xrandr --output $CENTER --primary --auto --output $RIGHT --auto --right-of $CENTER --output $LAPTOP --off
# back to normal: Enter or Escape
bindsym Return mode "default"
bindsym Escape mode "default"
bindsym $mod+m mode "default"
}
bindsym $mod+p exec xrandr-toggle
workspace $WS1 output $EXTERN
workspace $WS2 output $EXTERN
# workspace $WS3 output $LAPTOP
workspace $WS3 output $LAPTOP
workspace $WS4 output $LAPTOP
workspace $WS5 output $EXTERN
workspace $WS8 output $LAPTOP
workspace $WS9 output $LAPTOP
# switch to workspace
bindsym $mod+1 workspace $WS1
bindsym $mod+2 workspace $WS2
bindsym $mod+3 workspace $WS3
bindsym $mod+4 workspace $WS4
bindsym $mod+5 workspace $WS5
bindsym $mod+6 workspace 6
bindsym $mod+7 workspace 7
bindsym $mod+8 workspace $WS8
bindsym $mod+9 workspace $WS9
bindsym $mod+0 workspace 10
# move focused container to workspace
bindsym $mod+Shift+1 move container to workspace $WS1
bindsym $mod+Shift+2 move container to workspace $WS2
bindsym $mod+Shift+3 move container to workspace $WS3
bindsym $mod+Shift+4 move container to workspace $WS4
bindsym $mod+Shift+5 move container to workspace $WS5
bindsym $mod+Shift+6 move container to workspace 6
bindsym $mod+Shift+7 move container to workspace 7
bindsym $mod+Shift+8 move container to workspace $WS8
bindsym $mod+Shift+9 move container to workspace $WS9
bindsym $mod+Shift+0 move container to workspace 10
# https://github.com/francma/wob
set $WOBSOCK $XDG_RUNTIME_DIR/wob.sock
exec mkfifo $WOBSOCK && tail -f $WOBSOCK | wob
# audio controls
bindsym XF86AudioRaiseVolume exec amixer sset Master 5%+ | sed -En 's/.*\[([0-9]+)%\].*/\1/p' | head -1 > $WOBSOCK
bindsym XF86AudioLowerVolume exec amixer sset Master 5%- | sed -En 's/.*\[([0-9]+)%\].*/\1/p' | head -1 > $WOBSOCK
bindsym XF86AudioMute exec amixer sset Master toggle | sed -En '/\[on\]/ s/.*\[([0-9]+)%\].*/\1/ p; /\[off\]/ s/.*/0/p' | head -1 > $WOBSOCK
bindsym XF86MonBrightnessDown exec brightnessctl set 5%- | sed -En 's/.*\(([0-9]+)%\).*/\1/p' > $WOBSOCK
bindsym XF86MonBrightnessUp exec brightnessctl set +5% | sed -En 's/.*\(([0-9]+)%\).*/\1/p' > $WOBSOCK
# bindsym XF86AudioRaiseVolume exec amixer set Master 5+ #increase sound volume
# bindsym XF86AudioLowerVolume exec amixer set Master 5- #decrease sound volume
# bindsym XF86AudioMute exec amixer set Master 1+ toggle # mute sound
# bindsym XF86AudioMicMute exec amixer set Capture toggle # mute mic
# reload the configuration file
bindsym $mod+Shift+c reload
# restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
bindsym $mod+Shift+r restart
# exit i3 (logs you out of your X session)
bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -b 'Yes, exit i3' 'i3-msg exit'"
# resize window (you can also use the mouse for that)
mode "resize" {
# These bindings trigger as soon as you enter the resize mode
# Pressing left will shrink the windows width.
# Pressing right will grow the windows width.
# Pressing up will shrink the windows height.
# Pressing down will grow the windows height.
bindsym j resize shrink width 10 px or 10 ppt
bindsym i resize grow height 10 px or 10 ppt
bindsym k resize shrink height 10 px or 10 ppt
bindsym l resize grow width 10 px or 10 ppt
# same bindings, but for the arrow keys
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+r mode "resize"
# Start i3bar to display a workspace bar (plus the system information i3status
# finds out, if available)
# actually use the rust port https://github.com/greshake/i3status-rust
bar {
colors {
background #223232
statusline #93b4a6
# focused_workspace #7d9683 #6c71c4 #fdf6e3
# active_workspace #fdf6e3 #6c71c4 #fdf6e3
# inactive_workspace #002b36 #586e75 #002b36
# urgent_workspace #d33682 #d33682 #fdf6e3
}
status_command ~/.cargo/bin/i3status-rs ~/dotfiles/sway/status-rust.toml
# tray_output $LAPTOP
tray_output primary
output $LAPTOP
output $EXTERN
font pango:DejaVu Sans Mono, FontAwesome 8
}
bar {
# position top
colors {
background #323232
statusline #93b4a6
focused_workspace #7d9683 #6c71b4 #ede6b3
active_workspace #fdf6e3 #6c71b4 #ede6b3
# focused_workspace #7d9683 #6c71c4 #fdf6e3
# active_workspace #fdf6e3 #6c71c4 #fdf6e3
inactive_workspace #002b36 #586e75 #002b36
urgent_workspace #d33682 #d33682 #fdf6e3
}
status_command i3status --config ~/dotfiles/.i3/status.conf
tray_output $LAPTOP
# i3blocks: http://kumarcode.com/Colorful-i3/
# status_command i3blocks -c ~/.i3/i3blocks.conf
output $LAPTOP
output $CENTER
font pango:DejaVu Sans Mono, FontAwesome 8
}
# bar {
# # output $CENTER
# output $RIGHT
# status_command i3status --config ~/.i3/status_small.conf
# tray_output $LAPTOP
# }
# startup programs
exec swaymsg 'exec mako -c /home/fschl/dotfiles/sway/mako.conf'
exec swaymsg 'udiskie'
exec swaymsg 'workspace $WS1; exec firefox;'
exec swaymsg 'workspace $WS2; exec emacs-29.0.50'
exec swaymsg 'workspace $WS3; exec alacritty;'
exec swaymsg 'workspace $WS4; exec thunderbird'
exec swaymsg 'workspace $WS8; exec keepassxc'

27
sway/mako.conf Executable file
View File

@ -0,0 +1,27 @@
sort=-time
layer=overlay
background-color=#1e1420
width=380
height=110
border-size=2
border-color=#88c0d0
border-radius=15
icons=0
max-icon-size=64
default-timeout=5000
ignore-timeout=1
font=monospace 14
[urgency=low]
border-color=#cccccc
[urgency=normal]
border-color=#d08770
[urgency=high]
border-color=#bf616a
default-timeout=0
[category=mpd]
default-timeout=2000
group-by=category

104
sway/status-rust.toml Normal file
View File

@ -0,0 +1,104 @@
[theme]
name = "semi-native"
# theme = "solarized-dark"
[theme.overrides]
separator = "<span font='5'>|</span>"
[icons]
name = "awesome"
[[block]]
block = "pomodoro"
length = 25
break_length = 5
message = "Take a break!"
break_message = "Back to work!"
notifier = "swaynag"
[[block]]
block = "disk_space"
path = "/"
info_type = "available"
unit = "GB"
interval = 20
warning = 12.0
alert = 8.0
alert_absolute = true
format = "{icon}/{available}"
[[block]]
block = "disk_space"
path = "/home"
info_type = "available"
unit = "GB"
interval = 20
warning = 20.0
alert = 10.0
alert_absolute = true
format = "{icon}/home {available}"
# [[block]]
# block = "docker"
# interval = 2
# format = "{running}/{total} | {images}"
[[block]]
block = "memory"
display_type = "memory"
format_mem = "{mem_used_percents}"
format_swap = "{swap_used_percents}"
[[block]]
block = "cpu"
interval = 5
[[block]]
block = "load"
interval = 5
format = "{1m}"
[[block]]
block = "net"
device = "enp0s25"
format = "eth {ip} {speed_down;K*b} {graph_down;K*b}"
interval = 5
[[block]]
block = "net"
device = "wlp3s0"
on_click = "alacritty -e nmtui"
format = "{ssid} {signal_strength} {ip} {speed_down;K*b}"
# format = "{ssid} {signal_strength} {ip} {speed_down;K*b} {graph_down;K*b}"
interval = 5
[[block]]
block = "sound"
format = "{volume}"
show_volume_when_muted = true
# [[block]]
# block = "sound"
# name = "Mic"
# format = "{output_name} {volume}"
# show_volume_when_muted = true
[[block]]
block = "battery"
# driver = "upower"
driver = "sysfs"
format = "{percentage} {time}"
allow_missing = true
[[block]]
block = "networkmanager"
on_click = "alacritty -e nmtui"
interface_name_exclude = ["br\\-[0-9a-f]{12}", "docker\\d+"]
interface_name_include = []
ap_format = "{ssid^10}"
[[block]]
block = "time"
timezone = "Europe/Berlin"
interval = 5
format = "%a %Y-%m-%d %R:%S"

View File

@ -68,7 +68,7 @@
*** Sync the configuration without restarting the interface
From `man wg-quick`: The strip command is useful for reloading configuration
From ~man wg-quick~: The strip command is useful for reloading configuration
files without disrupting ac tive sessions:
#+begin_src bash