commit 1a1e0c3028875be1806982c016093d87e5761efb
parent b3003041ab5e170c8cc5e2e3678c48b7b9ecb9c8
Author: Rikard Karlsen <rk@cassettian.space>
Date: Mon, 28 Dec 2020 13:28:19 +0100
2020-12-28
Diffstat:
39 files changed, 651 insertions(+), 221 deletions(-)
diff --git a/.config/X11/xinitrc b/.config/X11/xinitrc
@@ -1,16 +1,26 @@
-#!/bin/sh
+#export XDG_SESSION_TYPE=x11
+#export GDK_BACKEND=x11
+#exec gnome-session
-# Start programmer for graphische miljøer
-#backweb & # Sett bakgrunnen
-./.fehbg
-unclutter & # Gøym musa etter ei stund
-dunst & # Meldingsbokar
-compton -bfc # Gennomsiktighet
-sxhkd & # Enkel X Heiteknapper Demon
-[ "$WM" = "dwm" ] dwmbar & # dwm bar
-xkbutil set "$(cat $XDG_CONFIG_HOME/keymaps/current-layout)" &
-#minuttvarsel &
+if [[ "$WM" != "bspwm" ]]; then
+ sxhkd -c ~/.config/sxhkd/sxhkdrc_universal &
+fi
-#while :; do
-"$WM"
-#done
+[ "$WM" = "dwm" ] && dwmbloxx &
+
+#(echo $HOME/.config/sxhkd/sxhkdrc | entr pkill -USR1 -x sxhkd) &
+
+#[ -f "$XDG_CONFIG_HOME/keymaps/xkeymap" ] && xkbcomp "$XDG_CONFIG_HOME/keymaps/xkeymap" $DISPLAY
+xkbutil set NO
+
+[ "$(xrandr | grep "VGA-0 connected" | wc -l)" = "1" ] && \
+[ "$(xrandr | grep "DVI-0 connected" | wc -l)" = "1" ] && \
+xrandr --output VGA-0 --off --output LVDS --mode 1400x1050 --pos 0x0 --rotate normal --output DVI-0 --primary --mode 1920x1080 --pos 1400x0 --rotate normal && \
+sleep 1s && \
+xrandr --output VGA-0 --mode 1280x1024 --pos 1920x0 --rotate normal --output LVDS --off --output DVI-0 --primary --mode 1920x1080 --pos 0x45 --rotate normal
+
+unclutter &
+xwallpaper --zoom ~/.config/wallpaper &
+redshift -t 5500:3500 &
+
+exec "$WM"
diff --git a/.config/aliases b/.config/aliases
@@ -2,22 +2,25 @@
# Aliases
# Dotfiles management
-#alias dotties="git --git-dir=$HOME/.dotties/ --work-tree=$HOME/"
+alias dotties="git --git-dir=$HOME/.dotties.git/ --work-tree=$HOME/"
# General
alias ls="ls -hN --color=auto --group-directories-first"
+alias lsl="ls -l"
alias ll="ls -lAgG"
alias grep="grep --color=auto"
alias diff="diff --color=auto"
#alias edit="$EDITOR"
alias vim="nvim"
alias alert='notify-send --urgency=low "$([ $? = 0 ] && echo "Suksess" || echo "Feil")" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'
+alias groff="groff -Kutf8 -P-pa4 -dpaper=a4"
# Snarvegar
alias cfi="$EDITOR $XDG_CONFIG_HOME/i3/config"
alias cfx="$EDITOR $XDG_CONFIG_HOME/X11/xinitrc"
alias cfa="$EDITOR $XDG_CONFIG_HOME/aliases"
alias cfs="$EDITOR $XDG_CONFIG_HOME/sxhkd/sxhkdrc"
+alias cfb="$EDITOR $XDG_CONFIG_HOME/bspwm/bspwmrc"
alias cfp="$EDITOR $HOME/.profile"
alias cfz="$EDITOR $HOME/.zshrc"
diff --git a/.config/bspwm/asd b/.config/bspwm/asd
@@ -1 +0,0 @@
-.
diff --git a/.config/bspwm/bspwmrc b/.config/bspwm/bspwmrc
@@ -1,24 +1,59 @@
#! /bin/sh
-sxhkd &
-~/.fehbg &
-unclutter &
+
+# If refreshing bspwm, remove all previous rules to prevent doubling up.
+bspc rule -r "*"
+
+run_if_not_running() {
+ [ "$(pgrep $1)" = "" ] && $1 $2 &
+}
+
+run_if_not_running sxhkd
+run_if_not_running unclutter
+xcompmgr &
+dunst &
+run_if_not_running redshift "-t 5500:3500"
+
+# We look for a non-laptop monitor to use for default, but use the laptop
+# screen (LVDS) if there's nothing else. This is because I assume that if you
+# have an extra screen attached to a laptop, you want to use that.
+#mainmonitor="$(bspc query --monitors --names | grep -v LVDS | head -n 1)"
+
+
+#if ! echo "$mainmonitor" | grep LVDS >/dev/null 2>&1; then
+# xrandr --output "$mainmonitor" --auto --output LVDS --off
+#fi
+
+#xrandr --output LVDS --auto
+
+# Start workspaces on the main monitor.
+bspc monitor $mainmonitor -d 1 2 3 4 5 6 7 8 9 10
+# bspc monitor $mainmonitor -d A B C D E F G H I J
+# bspc monitor $mainmonitor -d Zevs Hera Poseidon Demeter Dionysos Apollon Artemis Hermes Athene Ares
+# bspc monitor $mainmonitor -d А Б В Г Д Е Ё Ж З И
+# bspc monitor $mainmonitor -d Ⰰ Ⰱ Ⰲ Ⰳ Ⰴ Ⰵ Ⰶ Ⰷ Ⰸ Ⰺ
#bspc monitor -d I II III IV V VI VII VIII IX X
-bspc monitor VGA-0 -d I II III IV V
-bspc monitor LVDS -d VI VII VIII IX X
+#bspc monitor VGA-0 -d I II III IV V
+#bspc monitor LVDS -d VI VII VIII IX X
+
+# ~/.local/bin/lemonbar-text | lemonbar -p -g x24 -B "#44111111" -f "Go:size=11" -f "Font Awesome" &
+lemonblocks &
+~/.fehbg &
-bspc config border_width 0
-bspc config window_gap 0
+bspc config border_width 1
+bspc config window_gap 0
+# if panelbar-thing then bspc config top_padding 24
+bspc config focus_follows_pointer true
bspc config split_ratio 0.5
bspc config borderless_monocle true
bspc config gapless_monocle true
-bspc rule -a Gimp desktop='^8' state=floating follow=on
-bspc rule -a Chromium desktop='^2'
-bspc rule -a mplayer2 state=floating
-bspc rule -a Kupfer.py focus=on
-bspc rule -a Screenkey manage=off
+# bspc rule -a Gimp desktop='^8' state=floating follow=on
+# bspc rule -a mplayer2 state=floating
+# bspc rule -a Kupfer.py focus=on
+# bspc rule -a Screenkey manage=off
bspc rule -a Surf state=tiled
bspc rule -a Zathura state=tiled
+bspc rule -a Gnome-calculator state=floating+
\ No newline at end of file
diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim
@@ -8,6 +8,7 @@ filetype plugin on
syntax on
set encoding=utf-8
set number
+set tabstop=4
set splitbelow splitright
diff --git a/.config/sxhkd/sxhkdrc b/.config/sxhkd/sxhkdrc
@@ -1,46 +1,69 @@
#!/bin/sh
-# Šenerelle
+# Generelle
super + {_,shift +} Return
$TERMINAL {_,-e tmux}
super + Tab
- rofi -show combi -modi combi -theme sidebar
+ rofi -show run -theme sidetab
super + space
- xkbutil toggle
-
-super + Delete
- lockscreen
+ xkbutil toggle && lemonblocks-reload keymap
# focus the node in the given direction
-super + {_,shift + }{left,down,up,right}
- [ "$WM" = "bspwm" ] && bspc node -{f,s} {west,south,north,east}; \
- [ "$WM" = "i3" ] && i3-msg {focus,move} {left,down,up,right}
+super + {_,shift +} {Left,Down,Up,Right}
+ bspc node -{f,s} {west,south,north,east}
+
+super + control + {Left,Right}
+ bspc desktop -f {prev,next}.local && lemonblocks-reload desktops
+
+super + {_,shift +} {1-9,0}
+ bspc {desktop -f,node -d} '^{1-9,10}' && \
+ lemonblocks-reload desktops
-super + control + {left,right}
- [ "$WM" = "bspwm" ] && bspc desktop -f {prev,next}.local; \
- [ "$WM" = "i3" ] && i3-msg workspace {prev,next}
+# expand a window by moving one of its side outward
+super + alt + Right
+ bspc node -z right 20 0
-#super + {_,shift +} {1-9,0}
-# [ "$WM" = "bspwm" ] && bspc {desktop -f,node -d} '^{1-9,10}'
+super + alt + Left
+ bspc node -z right -20 0
+
+# PageUp og PageDown
+super + {_,shift +} {Next,Prior}
+ amixer sset Master {10,20}%{-,+} && lemonblocks-reload volume
+
+super + {Home,End}
+ amixer sset Master {100,50}% && lemonblocks-reload volume
# Bokstavkombinasjonssnarveier
super + q
- [ "$WM" = "bspwm" ] && bspc node -c; \
- [ "$WM" = "i3" ] && i3-msg kill
+ bspc node -c;
super + w
- bookmarksurfing
+ dugrep mkv,mp4,avi vlc
+ #bookmarksurfing
+
+super + e
+ thunar
super + r
- st -e ranger
+ gnumeric "$HOME/git/regneskap/regneskap-2020.ods"
super + control + r
- reloadwm
+ $HOME/.local/bin/reloadwm
-super + t
- [ "$WM" = "i3" ] && i3-msg split toggle
+#super + t
+# [ "$WM" = "i3" ] && i3-msg split toggle
+
+super + {_,shift +} y
+ mpv "$(xclip -out)"
+ #youtube-dl "$(xclip -out)" -o - | vlc - {_,--sout "#chromecast" --sout-chromecast-ip="192.168.10.178"}
+
+#super + shift + y
+# surf "https://www.yr.no/stad/Noreg/Vestfold_og_Telemark/Larvik/Larvik/time_for_time.html"
+
+super + p
+ thunderbird
super + shift + i
$TERMINAL -e htop
@@ -52,52 +75,60 @@ super + a
$TERMINAL -e pulsemixer
super + s
- openstream
+ echo "rk@cassettian.space\nriq@192.168.1.4" | rofi -dmenu | xargs urxvt -e ssh
+ # openstream
-super + f
- [ "$WM" = "i3" ] && i3-msg fullscreen toggle
+#super + f
+# [ "$WM" = "i3" ] && i3-msg fullscreen toggle
# Swap the current node and the biggest node
super + g
- [ "$WM" = "bspwm" ] && bspc node -s biggest
+ gnome-calculator
super + h
surf "https://www.hurtigruten.no/kart/?shipCode=MS"
+super + l
+ i3lock -ei "$XDG_CONFIG_HOME/lock-img.png" -p win
+
super + x
- [ "$WM" = "bspwm" ] && bspc quit; \
- [ "$WM" = "i3" ] && [ "$(echo -e 'Nei\nJa' | dmenu -p 'Vil du avslutte i3?')" = "Ja" ] && i3-msg exit
+ [ "$(echo -e 'Nei\nJa' | rofi -dmenu -p 'Vil du logge av?' -lines 2)" = "Ja" ] && bspc quit
super + shift + x
- [ "$(echo -e 'Nei\nJa' | dmenu -p 'Vil du slå av PC-en?')" = "Ja" ] && $TERMINAL -e "sudo shutdown -h now"
+ [ "$(echo -e 'Nei\nJa' | rofi -dmenu -p 'Vil du slå av PC-en?' -lines 2)" = "Ja" ] && $TERMINAL -e "sudo shutdown -h now"
+
+super + c
+ _file="$(du -a $XDG_CONFIG_HOME | cut -f2 | rofi -dmenu -p "")" && [ "$_file" != "" ] && code "$_file"
super + v
wiktionaire
super + n
- dugrep-ms
+ dugrep pdf zathura
super + shift + n
- dugrep-pdf
+ dugrep groff code && sleep 1s && lemonblocks-reload volume
+
+super + {_,shift +} m
+ amixer sset Master {toggle,mute} && lemonblocks-reload volume
# Screenshots and recording
{_,shift +} Print
- cd $HOME/skjermdumper && scrot -z{_,u}
+ cd $HOME/Bilder/skjermdumper && scrot -z{_,u} && cd
super + {_,shift +} Print
dmenurecord {_,kill}
#F keys
-super + F3
- $TERMINAL -e "sudo wifi-menu"
-
+super + {_,shift +} F5
+ $HOME/.local/bin/wifi-select {_,-n}
# XF86 Keys
XF86AudioMute
- volumkontroll toggle
+ amixer sset Master toggle && lemonblocks-reload volume
XF86Audio{Lower,Raise}Volume
- volumkontroll change {-,+}5
+ amixer sset Master {10,20}%{-,+} && lemonblocks-reload volume
XF86AudioNext
cmus-remote --next
diff --git a/.config/sxhkd/sxhkdrc_universal b/.config/sxhkd/sxhkdrc_universal
@@ -0,0 +1,116 @@
+#!/bin/sh
+
+# Generelle
+super + Return
+ $TERMINAL
+
+super + Tab
+ rofi -show run -theme sidetab
+
+super + space
+ xkbutil toggle && lemonblocks-reload keymap
+
+# PageUp og PageDown
+super + {_,shift +} {Next,Prior}
+ amixer sset Master {10,20}%{-,+} && lemonblocks-reload volume
+
+super + {Home,End}
+ amixer sset Master {100,50}% && lemonblocks-reload volume
+
+super + w
+ dugrep mkv,mp4,avi mpv
+
+super + e
+ $TERMINAL -e ranger
+
+super + r
+ gnumeric "$HOME/git/regneskap/regneskap-2020.ods"
+
+super + control + r
+ $HOME/.local/bin/reloadwm
+
+super + y
+ mpv "$(xclip -out)"
+ #youtube-dl "$(xclip -out)" -o - | vlc - {_,--sout "#chromecast" --sout-chromecast-ip="192.168.10.178"}
+
+super + shift + y
+ surf "https://www.yr.no/stad/Noreg/Vestfold_og_Telemark/Larvik/Larvik/time_for_time.html"
+
+super + p
+ thunderbird
+
+super + shift + i
+ $TERMINAL -e htop
+
+super + o
+ wiktionaire uib
+
+super + a
+ $TERMINAL -e pulsemixer
+
+super + s
+ urxvt -e ssh riq@192.168.10.173
+
+# Swap the current node and the biggest node
+super + g
+ gnome-calculator
+
+super + h
+ surf "https://www.hurtigruten.no/kart/?shipCode=MS"
+
+super + l
+ i3lock -ei "$XDG_CONFIG_HOME/lock-img.png" -p win
+
+#super + x
+# [ "$(echo -e 'Nei\nJa' | rofi -dmenu -p 'Vil du logge av?' -lines 2)" = "Ja" ] && bspc quit
+
+super + shift + x
+ [ "$(echo -e 'Nei\nJa' | rofi -dmenu -p 'Vil du slå av PC-en?' -lines 2)" = "Ja" ] && $TERMINAL -e "sudo shutdown -h now"
+
+super + c
+ _file="$(du -a $XDG_CONFIG_HOME | cut -f2 | rofi -dmenu -p "")" && [ "$_file" != "" ] && code "$_file"
+
+super + v
+ wiktionaire
+
+super + n
+ dugrep pdf zathura
+
+super + shift + n
+ dugrep groff code && sleep 1s && lemonblocks-reload volume
+
+super + {_,shift +} m
+ amixer sset Master {toggle,mute} && lemonblocks-reload volume
+
+# Screenshots and recording
+{_,shift +} Print
+ cd $HOME/Bilder/skjermdumper && scrot -z{_,u} && cd
+
+super + {_,shift +} Print
+ dmenurecord {_,kill}
+
+#F keys
+super + {_,shift +} F5
+ $HOME/.local/bin/wifi-select {_,-n}
+
+# XF86 Keys
+XF86AudioMute
+ amixer sset Master toggle && lemonblocks-reload volume
+
+XF86Audio{Lower,Raise}Volume
+ amixer sset Master {10,20}%{-,+} && lemonblocks-reload volume
+
+XF86AudioNext
+ cmus-remote --next
+
+XF86AudioPlay
+ cmus-remote --pause
+
+XF86AudioPrev
+ cmus-remote --prev
+
+XF86AudioStop
+ cmus-remote --stop
+
+XF86Sleep
+ lockscreen
diff --git a/.config/termite/config b/.config/termite/config
@@ -1,18 +1,92 @@
[options]
-#font = UbuntuMono 12
-font = Inconsolata 12
-allow_bold = true
-dynamic_title = true
-cursor_blink = system
+#allow_bold = true
+#audible_bell = false
+#bold_is_bright = true
+#cell_height_scale = 1.0
+#cell_width_scale = 1.0
+#clickable_url = true
+#dynamic_title = true
+#font = Ubuntu Mono 13
+font = Go Mono 11
+#font = Inconsolata 12
+#fullscreen = true
+#icon_name = terminal
+#mouse_autohide = false
+#scroll_on_output = false
+#scroll_on_keystroke = true
+# Length of the scrollback buffer, 0 disabled the scrollback buffer
+# and setting it to a negative value means "infinite scrollback"
+scrollback_lines = 10000
+#search_wrap = true
+#urgent_on_bell = true
+#hyperlinks = false
+
+# $BROWSER is used by default if set, with xdg-open as a fallback
+#browser = xdg-open
+
+# "system", "on" or "off"
+#cursor_blink = system
+
+# "block", "underline" or "ibeam"
+#cursor_shape = block
+
+# Hide links that are no longer valid in url select overlay mode
+#filter_unmatched_urls = true
+
+# Emit escape sequences for extra modified keys
+#modify_other_keys = false
+
+# set size hints for the window
+#size_hints = false
+
+# "off", "left" or "right"
+#scrollbar = off
[colors]
+# If both of these are unset, cursor falls back to the foreground color,
+# and cursor_foreground falls back to the background color.
+#cursor = #dcdccc
+#cursor_foreground = #dcdccc
+
+#foreground = #dcdccc
+#foreground_bold = #ffffff
+#background = #3f3f3f
+
+# 20% background transparency (requires a compositor)
+background = rgba(63, 63, 63, 0.9)
+#background = rgba(90, 00, 80, 0.9)
#foreground = #ffffff
-#background = #333333
-# Ubuntu colors
-#background = #350101
-#background = #2C001E
-background = rgba(44, 00, 30, 0.9)
-foreground = #ffffff
-cursor = #ffffff
+# If unset, will reverse foreground and background
+highlight = #2f2f2f
+
+# Colors from color0 to color254 can be set
+color0 = #3f3f3f
+color1 = #705050
+color2 = #60b48a
+color3 = #dfaf8f
+color4 = #506070
+color5 = #dc8cc3
+color6 = #8cd0d3
+color7 = #dcdccc
+color8 = #709080
+color9 = #dca3a3
+color10 = #c3bf9f
+color11 = #f0dfaf
+color12 = #94bff3
+color13 = #ec93d3
+color14 = #93e0e3
+color15 = #ffffff
+
+[hints]
+#font = Monospace 12
+#foreground = #dcdccc
+#background = #3f3f3f
+#active_foreground = #e68080
+#active_background = #3f3f3f
+#padding = 2
+#border = #3f3f3f
+#border_width = 0.5
+#roundness = 2.0
+# vim: ft=dosini cms=#%s
diff --git a/.config/user-dirs.dirs b/.config/user-dirs.dirs
@@ -6,10 +6,10 @@
# absolute path. No other format is supported.
#
XDG_DESKTOP_DIR="$HOME/"
-XDG_DOWNLOAD_DIR="$HOME/nedlastingar"
+XDG_DOWNLOAD_DIR="$HOME/Nedlastinger"
XDG_TEMPLATES_DIR="$HOME/"
-XDG_PUBLICSHARE_DIR="$HOME/offentleg"
-XDG_DOCUMENTS_DIR="$HOME/dokumenter"
-XDG_MUSIC_DIR="$HOME/musikk"
-XDG_PICTURES_DIR="$HOME/bilder"
+XDG_PUBLICSHARE_DIR="$HOME/Offentlig"
+XDG_DOCUMENTS_DIR="$HOME/Dokumenter"
+XDG_MUSIC_DIR="$HOME/"
+XDG_PICTURES_DIR="$HOME/Bilder"
XDG_VIDEOS_DIR="$HOME/"
diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc
@@ -0,0 +1,27 @@
+# .zshrc
+
+# Fixes for the Home, End and Delete buttons
+bindkey "\e[H" beginning-of-line
+bindkey "\e[F" end-of-line
+bindkey "\e[3~" delete-char
+
+HISTFILE="$XDG_DATA_HOME/zsh/histfile"
+HISTSIZE=10000
+SAVEHIST=10000
+PROMPT='%F{yellow}[%~]%f '
+
+setopt appendhistory autocd extendedglob nomatch notify
+setopt HIST_IGNORE_DUPS
+unsetopt beep
+bindkey -v
+
+# Plugins
+zstyle :compinstall filename '~/.zshrc'
+
+autoload -Uz compinit && compinit
+
+source /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh
+source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
+
+# Aliases
+[ -f "$XDG_CONFIG_HOME/aliases" ] && source "$XDG_CONFIG_HOME/aliases"
diff --git a/.local/bin/bookmarksurfing.d/bookmarks b/.local/bin/bookmarksurfing.d/bookmarks
@@ -1,13 +0,0 @@
-duckduckgo.com/?q=
-github.com/taco-c
-nrk.no
-youtube.com/search?q=
-wiki.archlinux.org/index.php?search=
-en.wikipedia.org/w/index.php?search=
-en.wiktionary.org/w/index.php?search=
-yr.no/place/Norway/Vestfold/Larvik/Larvik/hour_by_hour.html
-timeanddate.com/sun/norway/larvik
-lsm.lv
-ltv.lsm.lv/lv/tieshraide/visiemltv.lv/live.1480
-gazeta.ru
-live.russia.tv
diff --git a/.local/bin/dugrep b/.local/bin/dugrep
@@ -2,7 +2,16 @@
# Find all files with the .$1 extention, lets you choose one, then exec with $2.
-file=`du -a $HOME --exclude=".*" 2>/dev/null | grep "\.$1$" | cut -f2 | rofi -dmenu -theme sidebar -p :`
+# theme="-theme sidebar"
+theme=""
+
+_filter_files() {
+ for ext in $(echo $1 | tr "," "\n"); do
+ du -a $HOME --exclude=".*" | cut -f2 | grep "\.$ext$"
+ done
+}
+
+file=`_filter_files "$1" | sort | rofi -width 75% -dmenu -i $theme -p :`
[ "$file" = "" ] && exit
diff --git a/.local/bin/dugrep-ms b/.local/bin/dugrep-ms
@@ -1,3 +0,0 @@
-#!/bin/sh
-
-dugrep ms $EDITOR -
diff --git a/.local/bin/dugrep-pdf b/.local/bin/dugrep-pdf
@@ -1,3 +0,0 @@
-#!/bin/sh
-
-dugrep pdf $READER
diff --git a/.local/bin/dwarffortress b/.local/bin/dwarffortress
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+$HOME/.local/games/dwarf-fortress/0.47.04/df
diff --git a/.local/bin/dwmbloxx b/.local/bin/dwmbloxx
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+_battery() {
+ capasity="$(cat /sys/class/power_supply/BAT0/capacity)%"
+ status="$(cat /sys/class/power_supply/BAT0/status)"
+ echo $capasity $status
+}
+
+_keymap() {
+ cat ~/.config/keymaps/current-layout
+}
+
+while true; do
+ xsetroot -name "$(_keymap) | $(_battery) | $(ordur)"
+ sleep 1s
+done
diff --git a/.local/bin/edit.d/filelist b/.local/bin/edit.d/filelist
@@ -1,2 +0,0 @@
-skildringar.ms ~/prosjekter/turlogg/skildringar.ms
-opplevingar.ms ~/prosjekter/turlogg/opplevingar.ms
diff --git a/.local/bin/if_monitor_setup_do_xrandr_stuff.sh b/.local/bin/if_monitor_setup_do_xrandr_stuff.sh
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+# Jeg tror det skriptet som funker ligger i ~/.config/X11/xinitrc
+
+[ "$(xrandr | grep "VGA-0 connected" | wc -l)" = "1" ] && \
+[ "$(xrandr | grep "DVI-0 connected" | wc -l)" = "1" ] && \
+ xrandr --output VGA-0 --off --output LVDS --mode 1400x1050 --pos 0x0 --rotate normal --output DVI-0 --primary --mode 1920x1080 --pos 1400x0 --rotate normal && \
+ xrandr --output VGA-0 --mode 1280x1024 --pos 1920x0 --rotate normal --output LVDS --off --output DVI-0 --primary --mode 1920x1080 --pos 0x0 --rotate normal
diff --git a/.local/bin/lemonblocks b/.local/bin/lemonblocks
@@ -0,0 +1,96 @@
+#!/bin/sh
+
+_desktops() {
+ #desktops=$(bspc query -D --names)
+ active_desktop=$(bspc query -D -d --names)
+ for d in $(bspc query -D -m --names); do
+ [ $active_desktop = $d ] && item="%{R} $d %{R}" || item=" $d "
+ ret="$ret$item"
+ done
+ echo "$ret "
+}
+
+_keymap() {
+ cat "$XDG_CONFIG_HOME/keymaps/current-layout"
+}
+
+_window_title() {
+ echo ""
+}
+
+# mute icon: \uf6a9
+_volume() {
+ _vol_info=$(amixer sget Master | grep "Front Left:")
+ _vol=$(echo $_vol_info | awk '{print $5}' | tr -d "[]%")%
+ [ "$(echo $_vol_info | awk '{print $7}')" = "[off]" ] && _vol="M"
+ echo -e " $_vol "
+}
+
+_battery() {
+ batinfo=$(acpi --battery)
+ BATPERC=$(echo $batinfo | cut -d, -f2 | cut -d" " -f2 | cut -d% -f1)
+ state=$(echo $batinfo | awk '{print $3}' | cut -d, -f1)
+
+ bat=" $BATPERC% "
+
+ if [ "$state" = "Discharging" ]; then
+ [ "$BATPERC" = "15" ] && notify-send --urgency=low "Lavt batteri!" "15%"
+ [ "$BATPERC" = "10" ] && notify-send --urgency=normal "Veldig lavt batteri!" "10%"
+ [ "$BATPERC" -lt "6" ] && notify-send --urgency=critical "Ektremt lavt batteri!" "$BATPERC%"
+
+ if [ "$BATPERC" -lt "11" ]; then
+ bat="%{B#ff0000} $BATPERC% %{B-}"
+ elif [ "$BATPERC" -lt "21" ]; then
+ bat="%{B#ffff00}%{F#000000} $BATPERC% %{F-}%{B-}"
+ fi
+ elif [ "$state" = "Full" ]; then
+ bat="%{B#00ff00}%{F#000000} $BATPERC% %{F-}%{B-}"
+ fi
+
+ echo "$bat"
+}
+
+_clock() {
+ #DATETIME=$(date "+%A %d. %B %Y - %I:%M")
+ #DATETIME=$(date "+%-I:%-M")
+ DATETIME=$(ordur)
+ echo "$DATETIME"
+}
+
+_update() {
+ echo -e "%{l}$desks%{c}$(_clock)%{r}$keym%{R} $vol %{R}$(_battery)" &
+ wait
+}
+
+_update_desktops() {
+ desks=$(_desktops)
+ _update
+}
+
+_update_volume() {
+ vol=$(_volume)
+ _update
+}
+
+_update_keymap() {
+ keym=" $(_keymap) "
+ _update
+}
+
+_update_desktops > /dev/null
+_update_volume > /dev/null
+_update_keymap > /dev/null
+
+_lemonblocks() {
+ trap "_update_desktops" SIGRTMIN+1
+ trap "_update_volume" SIGRTMIN+2
+ trap "_update_keymap" SIGRTMIN+3
+
+ while true; do
+ _update
+ sleep 1m &
+ wait
+ done
+}
+
+_lemonblocks | lemonbar -p -g x24 -B "#44111111" -f "Go:size=10"+
\ No newline at end of file
diff --git a/.local/bin/lemonblocks-reload b/.local/bin/lemonblocks-reload
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+[ "$1" = "desktops" ] && pkill -SIGRTMIN+1 lemonblocks
+[ "$1" = "volume" ] && pkill -SIGRTMIN+2 lemonblocks
+[ "$1" = "keymap" ] && pkill -SIGRTMIN+3 lemonblocks+
\ No newline at end of file
diff --git a/.local/bin/lotro b/.local/bin/lotro
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+wine $HOME/.wine/drive_c/Program\ Files\ \(x86\)/StandingStoneGames/The\ Lord\ of\ the\ Rings\ Online/LotroLauncher.exe
diff --git a/.local/bin/nrkdownload b/.local/bin/nrkdownload
@@ -0,0 +1,8 @@
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+import re
+import sys
+from nrkdownload.commandline_script import main
+if __name__ == '__main__':
+ sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
+ sys.exit(main())
diff --git a/.local/bin/openstream.d/streamers b/.local/bin/openstream.d/streamers
@@ -1,4 +0,0 @@
-potatoandtaco
-stine
-inghelene
-manouk93
diff --git a/.local/bin/ordur b/.local/bin/ordur
@@ -7,17 +7,17 @@ if [ $m = "0" ]; then
elif [ $m -lt "15" ]; then
M="$m over"
elif [ $m -eq "15" ]; then
- M="kvart over"
+ M="Kvart over"
elif [ $m -lt "30" ]; then
d="$(expr 30 - $m)"
M="$d på halv"
elif [ $m -eq "30" ]; then
- M="halv"
+ M="Halv"
elif [ $m -lt "45" ]; then
d="$(expr $m - 30)"
M="$d over halv"
elif [ $m -eq "45" ]; then
- M="kvart på"
+ M="Kvart på"
else
d="$(expr 60 - $m)"
M="$d på"
@@ -26,13 +26,13 @@ fi
h="$(date '+%_I' | tr -d ' ')"
[ $m -gt "15" ] && h="$(date -d '1 hour' '+%_I' | tr -d ' ')"
-printf "$M $h"
+the_time="$M $h"
while getopts nd o; do
case $o in
- n) printf " på $(date '+%A')";;
- d) printf " den $(date '+%_d. %B')";;
+ n) the_time="$the_time på $(date '+%A')";;
+ d) the_time="$the_time den $(date '+%_d. %B')";;
esac
done
-printf "\n"
+echo "$the_time"
diff --git a/.local/bin/palemoon b/.local/bin/palemoon
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+$HOME/.local/bin/palemoon.d/palemoon
diff --git a/.local/bin/reloadwm b/.local/bin/reloadwm
@@ -1,12 +1,14 @@
#!/bin/sh
# WM
-[ "$WM" = "bspwm" ] && bspc wm -r
-[ "$WM" = "i3" ] && i3-msg restart
+bspc wm -r
# Backweb-skript
-pkill -u riq backweb && backweb &
+#pkill -u riq backweb && backweb &
+# ~/.fehbg &
# Sxhkd
pkill -USR1 -x sxhkd
+# Lemonbar
+pkill lemonbar
diff --git a/.local/bin/rgc b/.local/bin/rgc
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+_compile() {
+ _output="$(basename "$1" .${1##*.}).pdf"
+ groff -ms -Tpdf -Kutf8 -P-pa4 -dpaper=a4 "$1" > $_output
+}
+
+[ "$1" = "" ] && echo -e "The groff-compiler-wrapper\nUsage: rgc file" && exit
+
+_compile "$1"+
\ No newline at end of file
diff --git a/.local/bin/setwallpaper b/.local/bin/setwallpaper
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+[ -n "$1" ] && img=`realpath $1` || img=`sxiv /home/pat/Bilder/* -ot | head -n 1`
+
+ln -sf "$img" ~/.config/wallpaper
+xwallpaper --zoom ~/.config/wallpaper
diff --git a/.local/bin/sync-dotties b/.local/bin/sync-dotties
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+_sync() {
+ cp $1 $2/ && echo $1 "->" $2 || echo $1 "failed"
+}
+
+[ "$1" = "" ] && exit
+
+
+cd $HOME
+_sync ".profile" "$1"
+_sync ".zshrc" "$1"
+_sync ".config/aliases" "$1/.config"
+_sync ".config/bspwm/bspwmrc" "$1"
+_sync ".config/keymaps/*" "$1"
+_sync ".config/nvim/init.vim" "$1"
+_sync ".config/" "$1"
+
diff --git a/.local/bin/vga1080.sh b/.local/bin/vga1080.sh
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+#mode=`cvt 1920 1080 60 | grep "^Modeline" | sed 's/Modeline//'`
+#xrandr --newmode $(cvt 1920 1080 60 | grep "^Modeline" | sed 's/Modeline//')
+
+xrandr --newmode "1920x1080_60.00" 173.00 1920 2048 2248 2576 1080 1083 1088 1120 -hsync +vsync
+xrandr --addmode VGA-0 "1920x1080_60.00"
+xrandr --output VGA-0 --mode "1920x1080_60.00"
+xrandr --output LVDS --off
+
+xwallpaper --zoom Bilder/ivan.png
diff --git a/.local/bin/wifi-select b/.local/bin/wifi-select
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+_connect() {
+ # Gets list of saved configurations.
+ _saved_nets=`nmcli -f NAME con show | grep -v "^NAME"`
+
+ # Gets available networks.
+ _ssids=`nmcli device wifi list | grep -v "^IN" | cut -c2- | awk '{print $2}' | grep -v "^--$"`
+
+ # Filter the available networks based on the saved ones, and send to rofi.
+ _ssid=`echo "$_saved_nets" | grep "$_ssids" | rofi -dmenu`
+
+ [ "$_ssid" = "" ] && exit
+
+ nmcli device wifi connect $_ssid >/dev/null
+ _notify_current
+}
+
+_notify_current() {
+ _current=`nmcli device status | grep "^wls3" | awk '{print $4}'`
+ notify-send "IEEE 802.11b-nettverk" "$_current" --urgency=low
+}
+
+[ "$1" = "-n" ] && _notify_current || _connect+
\ No newline at end of file
diff --git a/.local/bin/wiktionaire b/.local/bin/wiktionaire
@@ -1,14 +1,13 @@
#!/bin/sh
-wikt_hist="$HOME_BIN/wiktionaire.d/history"
+wikt_dir="$XDG_DATA_HOME/wiktionaire"
+wikt_hist="$wikt_dir/history"
+[ ! -e "$wikt_dir" ] && mkdir -p $wikt_dir
-if [ "$1" = "uib" ]; then
- word="$(tac $wikt_hist | uniq | rofi -dmenu -theme sidebar -p "Søk i ordbøkene:" | tee -a $wikt_hist)"
-else
- word="$(tac $wikt_hist | uniq | rofi -dmenu -theme sidebar -p "Søk på wiktionary:" | tee -a $wikt_hist)"
-fi
+[ "$1" = "" ] && word="$(tac $wikt_hist | uniq | rofi -dmenu -theme sidebar -p "Søk på wiktionary:" | tee -a $wikt_hist)"
+[ "$1" = "uib" ] && word="$(tac $wikt_hist | uniq | rofi -dmenu -theme sidebar -p "Søk i ordbøkene:" | tee -a $wikt_hist)"
-url="$(echo $word | sed 's/.*/https:\/\/en.wiktionary.org\/w\/index.php?search=\0/')"
+[ "$1" = "" ] && url="$(echo $word | sed 's/.*/https:\/\/en.wiktionary.org\/w\/index.php?search=\0/')"
[ "$1" = "uib" ] && url="$(echo $word | sed 's/.*/https:\/\/ordbok.uib.no\/perl\/ordbok.cgi?OPP=\0\&ant_bokmaal=5\&ant_nynorsk=5\&begge=+\&ordbok=begge/')"
[ "$word" != "" ] && surf "$url"
diff --git a/.local/bin/wiktionaire.d/history b/.local/bin/wiktionaire.d/history
@@ -1,20 +0,0 @@
-hello
-hello
-hello
-hello
-hello
-hello
-hallelujah
-fele
-šovakar
-šovakar
-fele
-fele
-fele
-fele
-fele
-šovakar
-domus
-pennus
-займёмся
-займёмся
diff --git a/.local/bin/xkbutil b/.local/bin/xkbutil
@@ -9,13 +9,14 @@ _set () {
_toggle() {
if [ -f "$dir/current-layout" ]; then
layout="$(cat $dir/current-layout)"
- [ "$layout" = "NO" ] && _set "RU"
- [ "$layout" = "RU" ] && _set "NO"
+ case $layout in
+ "NO") _set "RU";;
+ "RU") _set "NO";;
+ esac
fi
}
-[ "$1" = "toggle" ] && _toggle
-[ "$1" = "set" ] && [ "$2" = "NO" ] && _set "NO"
-[ "$1" = "set" ] && [ "$2" = "RU" ] && _set "RU"
+[ "$1" = "toggle" ] && _toggle && exit 0
+[ "$1" = "set" ] && [ "$2" != "" ] && _set "$2" && exit 0
-[ "$WM" = "i3" ] && pkill -RTMIN+9 i3blocks
+echo "Usage: xkbutil [toggle|set layout]"+
\ No newline at end of file
diff --git a/.local/share/wiktionaire/history b/.local/share/wiktionaire/history
@@ -0,0 +1,6 @@
+han
+han
+han
+han
+ c
+test
diff --git a/.profile b/.profile
@@ -4,21 +4,13 @@ export TERMINAL="termite"
export EDITOR="nvim"
export BROWSER="palemoon"
export READER="zathura"
+export WM="dwm"
+export ZDOTDIR="$HOME/.config/zsh"
-export WM="bspwm"
-
-export INTERNET_IS_PRECIOUS="true"
-
-export HOME_BIN="$HOME/.local/bin"
-export BIN_HOME="$HOME_BIN"
-export PROSJEKTER="$HOME/prosjekter"
-
-# Golang
+#PATHs
export GOPATH="$HOME/go"
-
-# Path
-export PATH="$GOPATH/bin:$PATH"
-export PATH="$(du "$BIN_HOME/" | cut -f2 | tr '\n' ':'):$PATH"
+export BIN_HOME="$HOME/.local/bin"
+export PATH="$GOPATH/bin:$BIN_HOME:$PATH"
# XDG variables
## User directories
@@ -31,8 +23,15 @@ export XDG_CONFIG_DIRS="/etc/xdg"
# Xorg
export XINITRC="$XDG_CONFIG_HOME/X11/xinitrc"
+#export XAUTHORITY="$XDG_RUNTIME_DIR/Xauthority"
+
+#[ "$(tty)" = "/dev/tty1" ] && ! pgrep -x i3 >/dev/null && startx "$XINITRC"
+
+if [[ ! $DISPLAY && $XDG_VTNR -eq 1 ]]; then
+ exec startx "$XINITRC"
+fi
-[ ! $DISPLAY ] && [ $XDG_VTNR -eq 1 ] && exec startx "$XINITRC"
+#[ ! $DISPLAY ] && [ $XDG_VTNR -eq 1 ] exec startx "$XINITRC"
-sudo -n loadkeys "$XDG_CONFIG_HOME/keymaps/ttymap.kmap" 2>/dev/null
+#sudo -n loadkeys "$XDG_CONFIG_HOME/keymaps/ttymap.kmap" 2>/dev/null
diff --git a/.zprofile b/.zprofile
@@ -1 +1 @@
-.profile-
\ No newline at end of file
+/home/pat/.profile+
\ No newline at end of file
diff --git a/.zshrc b/.zshrc
@@ -1,26 +0,0 @@
-# .zshrc
-
-# Fixes for the Home, End and Delete buttons
-bindkey "\e[H" beginning-of-line
-bindkey "\e[F" end-of-line
-bindkey "\e[3~" delete-char
-
-HISTFILE="$XDG_DATA_HOME/zsh/histfile"
-HISTSIZE=10000
-SAVEHIST=10000
-PROMPT='%F{yellow}[%1~]%f '
-
-setopt appendhistory autocd extendedglob nomatch notify
-unsetopt beep
-bindkey -v
-
-# Plugins
-zstyle :compinstall filename '~/.zshrc'
-
-autoload -Uz compinit && compinit
-
-source /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh
-source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
-
-# Aliases
-[ -f "$XDG_CONFIG_HOME/aliases" ] && source "$XDG_CONFIG_HOME/aliases"
diff --git a/installed-packs b/installed-packs
@@ -1,28 +0,0 @@
-nvim
-zsh
-zsh-completions
-zsh-autosuggestions
-zsh-syntax-highlighting
-ranger
-termite
-surf
-i3-gaps
-xorg-server
-dmenu
-neocurses
-bspwm
-sxhkd
-dialog
-git
-dosbox
-unclutter
-thunderbird
-zathura
-zathura-pdf-mupdf
-go
-rofi
-gnome-twitch
-neofetch
-redshift
-palemoon
-micro