Compare commits
24 Commits
e11085ca91
...
e771a09fbe
Author | SHA1 | Date |
---|---|---|
Hektor Misplon | e771a09fbe | |
Hektor Misplon | b6ba9ab4ea | |
Hektor Misplon | 09812befdc | |
Hektor Misplon | f98b19f0b1 | |
Hektor Misplon | d2bf1ed9bd | |
Hektor Misplon | 3795d10197 | |
Hektor Misplon | b0df672009 | |
Hektor Misplon | 42df25d5cc | |
Hektor Misplon | ac066bb076 | |
Hektor Misplon | 01842d8f1e | |
Hektor Misplon | 4b74af8b99 | |
Hektor Misplon | 28d1e36003 | |
Hektor Misplon | 4708739c66 | |
Hektor Misplon | bb54ec3629 | |
Hektor Misplon | e9017047cd | |
Hektor Misplon | 6aefd6bd92 | |
Hektor Misplon | 71d8b33123 | |
Hektor Misplon | 93f223c1ec | |
Hektor Misplon | 3d1fe7b173 | |
Hektor Misplon | bab4c612f3 | |
Hektor Misplon | 16c87b6b4c | |
Hektor Misplon | 892ab35612 | |
Hektor Misplon | 958de4e03c | |
Hektor Misplon | fade05a394 |
|
@ -51,7 +51,6 @@ alias path='echo -e ${PATH//:/\\n}' # Pretty print path variables
|
||||||
# Programs
|
# Programs
|
||||||
alias o="xdg-open"
|
alias o="xdg-open"
|
||||||
alias v="nvim"
|
alias v="nvim"
|
||||||
alias zk='cd ~/.zk && nvim "$(cat ~/.zk/current-zettel.txt)"'
|
|
||||||
alias g='git'
|
alias g='git'
|
||||||
alias t=' task'
|
alias t=' task'
|
||||||
alias tsh='tasksh'
|
alias tsh='tasksh'
|
||||||
|
|
|
@ -3,7 +3,9 @@
|
||||||
[[ -f ~/.bashrc ]] && . ~/.bashrc
|
[[ -f ~/.bashrc ]] && . ~/.bashrc
|
||||||
|
|
||||||
export SSH_AUTH_SOCK="${XDG_RUNTIME_DIR}/ssh-agent.socket"
|
export SSH_AUTH_SOCK="${XDG_RUNTIME_DIR}/ssh-agent.socket"
|
||||||
|
export _JAVA_AWT_WM_NONREPARENTING=1
|
||||||
|
|
||||||
if [ -z "${DISPLAY}" ] && [ "${XDG_VTNR}" -eq 1 ]; then
|
|
||||||
|
if [[ -z "${DISPLAY}" ]] && [[ "${XDG_VTNR}" -eq 1 ]]; then
|
||||||
exec startx "$HOME/.config/X11/xinitrc"
|
exec startx "$HOME/.config/X11/xinitrc"
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -20,7 +20,7 @@ chmod +x <script>
|
||||||
## Notes
|
## Notes
|
||||||
|
|
||||||
Statusbar scripts are prefixed with `sb` under the assumption you're using
|
Statusbar scripts are prefixed with `sb` under the assumption you're using
|
||||||
`dwmblocks` (scripts my need changes to be used with different statusbars).
|
`polybar` (scripts my need changes to be used with different statusbars).
|
||||||
|
|
||||||
Some scripts have dependencies (e.g. `fzf`, `jq`, `xclip`, ...), make sure you
|
Some scripts have dependencies (e.g. `fzf`, `jq`, `xclip`, ...), make sure you
|
||||||
have them installed.
|
have them installed.
|
||||||
|
|
|
@ -22,3 +22,5 @@ case "$1" in
|
||||||
--help) printf "open \n" >&2 ;;
|
--help) printf "open \n" >&2 ;;
|
||||||
*) open "$(select_file)" ;;
|
*) open "$(select_file)" ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
[[ -n "$selected" ]] && xdg-open "$selected" &> /dev/null & disown
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
curl localhost:8765 -X POST -d '{"action": "deckNames", "version": 6}' | jq '.result[]' -r
|
curl 127.0.0.1:8765 -X POST -d '{"action": "deckNames", "version": 6}' | jq '.result[]' -r
|
||||||
|
|
11
.bin/pomo
11
.bin/pomo
|
@ -17,8 +17,8 @@ from plyer import notification
|
||||||
|
|
||||||
@atexit.register
|
@atexit.register
|
||||||
def clear():
|
def clear():
|
||||||
os.system('rm /tmp/pomo')
|
if os.path.exists('/home/h/.local/share/pomo'):
|
||||||
|
os.remove('/home/h/.local/share/pomo')
|
||||||
|
|
||||||
def format_mins_secs(mins, secs):
|
def format_mins_secs(mins, secs):
|
||||||
return f"{mins:02d}:{secs:02d}"
|
return f"{mins:02d}:{secs:02d}"
|
||||||
|
@ -30,7 +30,7 @@ def make_countdown():
|
||||||
mins = duration // 60
|
mins = duration // 60
|
||||||
secs = duration % 60
|
secs = duration % 60
|
||||||
time_str = format_mins_secs(mins, secs)
|
time_str = format_mins_secs(mins, secs)
|
||||||
os.system(f'echo -n "{time_str}" > /tmp/pomo')
|
os.system(f'echo -n "{time_str}" > /home/h/.local/share/pomo')
|
||||||
sleep(1)
|
sleep(1)
|
||||||
duration -= 1
|
duration -= 1
|
||||||
return countdown
|
return countdown
|
||||||
|
@ -68,15 +68,14 @@ def handle_signal(signal, frame):
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
||||||
parser = ArgumentParser()
|
parser = ArgumentParser()
|
||||||
|
|
||||||
parser.add_argument('-p', '--prep-duration', type=int,
|
|
||||||
help='Pre session duration', default=0)
|
|
||||||
parser.add_argument('-w', '--work-duration', type=int,
|
parser.add_argument('-w', '--work-duration', type=int,
|
||||||
help='Session duration', default=25)
|
help='Session duration', default=25)
|
||||||
parser.add_argument('-b', '--break-duration', type=int,
|
parser.add_argument('-b', '--break-duration', type=int,
|
||||||
help='Break duration', default=5)
|
help='Break duration', default=5)
|
||||||
parser.add_argument('-r', '--repeats', type=int,
|
parser.add_argument('-r', '--repeats', type=int,
|
||||||
help='Numer of sessions', default=1)
|
help='Numer of sessions', default=1)
|
||||||
|
parser.add_argument('-c', '--clear', action='store_true',
|
||||||
|
help='Clear timer')
|
||||||
|
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
|
|
|
@ -10,12 +10,12 @@
|
||||||
|
|
||||||
# https://unix.stackexchange.com/questions/100871/in-a-bash-if-condition-how-to-check-whether-any-files-matching-a-simple-wildcard
|
# https://unix.stackexchange.com/questions/100871/in-a-bash-if-condition-how-to-check-whether-any-files-matching-a-simple-wildcard
|
||||||
if [ 0 -lt "$(ls $HOME/doc/*.kdbx 2>/dev/null | wc -w)" ]; then
|
if [ 0 -lt "$(ls $HOME/doc/*.kdbx 2>/dev/null | wc -w)" ]; then
|
||||||
rclone copy "$HOME/doc" google-drive: --include "*.kdbx"
|
rclone copy "$HOME/doc" google-drive:doc --include "*.kdbx"
|
||||||
rclone copy "$HOME/doc" google-drive: --include "*.kdbx.key"
|
rclone copy "$HOME/doc" google-drive:doc --include "*.kdbx.key"
|
||||||
else
|
else
|
||||||
echo "No password database found, use the following commands to restore"
|
echo "No password database found, use the following commands to restore"
|
||||||
echo ""
|
echo ""
|
||||||
echo "rclone copy google-drive: \"$HOME/doc\" --include \"*.kdbx\""
|
echo "rclone copy google-drive:doc \"$HOME/doc\" --include \"*.kdbx\""
|
||||||
echo "rclone copy google-drive: \"$HOME/doc\" --include \"*.kdbx.key\""
|
echo "rclone copy google-drive:doc \"$HOME/doc\" --include \"*.kdbx.key\""
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
num_to_review=200
|
num_to_review=200
|
||||||
|
|
||||||
# Get current card count from Anki
|
# Get current card count from Anki
|
||||||
count=$(curl -s localhost:8765 -X POST -d '{"action": "getNumCardsReviewedToday", "version": 6}' | jq '.result')
|
count=$(curl -s 127.0.0.1:8765 -X POST -d '{"action": "getNumCardsReviewedToday", "version": 6}' | jq '.result')
|
||||||
|
|
||||||
if [ -z "$count" ]
|
if [ -z "$count" ]
|
||||||
then
|
then
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
ssh_hosts=$(grep -E 'Host [a-z0-9\-]*$' ~/.ssh/config | awk '{print $2}')
|
ssh_hosts="$(grep -E 'Host [a-z0-9\-]*$' ~/.ssh/config | awk '{print $2}')"
|
||||||
|
|
||||||
echo "$ssh_hosts"
|
echo "$ssh_hosts"
|
||||||
|
|
|
@ -3,16 +3,11 @@
|
||||||
session="main"
|
session="main"
|
||||||
|
|
||||||
tmux attach-session -t $session || tmux new-session -s $session \; \
|
tmux attach-session -t $session || tmux new-session -s $session \; \
|
||||||
rename-window todo \; \
|
rename-window task \; \
|
||||||
send-keys -t 0 "task" C-m \; \
|
send-keys -t 1 "task" C-m \; \
|
||||||
new-window -n zk \; \
|
new-window -n zk \; \
|
||||||
send-keys -t 0 "nvim $ZK_PATH/index.md" C-m \; \
|
send-keys -t 2 "nvim $ZK_PATH/index.md" C-m \; \
|
||||||
new-window -n music \; \
|
|
||||||
send-keys -t 0 "ncspot" C-m \; \
|
|
||||||
new-window -n term \; \
|
new-window -n term \; \
|
||||||
new-window -n make \; \
|
new-window -n music \; \
|
||||||
split-window -h \; \
|
send-keys -t 4 "echo 'TODO: open music player'" C-m \; \
|
||||||
split-window -h \; \
|
select-window -t 1 \;
|
||||||
send-keys -t 0 'cd "$ZK_PATH" && ./entr' C-m \; \
|
|
||||||
send-keys -t 1 'cd "$ZK_PATH" && live-server . --watch=*.html' C-m \; \
|
|
||||||
select-window -t 2 \;
|
|
||||||
|
|
|
@ -1,3 +0,0 @@
|
||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
xrandr -q --current | sed -n 's/^\([^ ]\+\) connected .*/\1/p'
|
|
|
@ -0,0 +1,33 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
if [ "$TERM_PROGRAM" = tmux ]; then
|
||||||
|
cd ~/.zk && $EDITOR "$(cat ~/.zk/current-zettel.txt)"
|
||||||
|
else
|
||||||
|
echo 'Not in tmux'
|
||||||
|
echo 'Choose an option:'
|
||||||
|
echo '1. Open in tmux'
|
||||||
|
echo '2. Open in current terminal'
|
||||||
|
read -r -p 'Enter your choice: ' choice
|
||||||
|
case $choice in
|
||||||
|
1)
|
||||||
|
# Check if a tmux session is running with a window named zk
|
||||||
|
if tmux list-windows -F '#{window_name}' | grep -q zk; then
|
||||||
|
# Attach to the session containing the 'zk' window
|
||||||
|
session="$(tmux list-windows -F '#{window_name} #{session_name}' | grep zk | head -n 1 | awk '{ print $2 }')"
|
||||||
|
tmux attach -t "$session"
|
||||||
|
else
|
||||||
|
# Create session with a window named 'zk' and start nvim
|
||||||
|
tmux new-session -s zk -n zk -d
|
||||||
|
tmux send-keys -t zk:zk "cd ~/.zk && $EDITOR \"\$(cat ~/.zk/current-zettel.txt)\"" Enter
|
||||||
|
tmux attach -t zk
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
2)
|
||||||
|
cd ~/.zk && $EDITOR "$(cat ~/.zk/current-zettel.txt)"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo 'Not opening Zettelkasten'
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
|
@ -0,0 +1,159 @@
|
||||||
|
[colors]
|
||||||
|
background = #cccccc
|
||||||
|
background-alt = #aaaaaa
|
||||||
|
foreground = #111111
|
||||||
|
primary = #111111
|
||||||
|
secondary = #555555
|
||||||
|
disabled = #888888
|
||||||
|
|
||||||
|
[bar/example]
|
||||||
|
height = 16pt
|
||||||
|
radius = 0
|
||||||
|
|
||||||
|
background = ${colors.background}
|
||||||
|
foreground = ${colors.foreground}
|
||||||
|
|
||||||
|
padding-left = 0pt
|
||||||
|
module-margin = 1
|
||||||
|
|
||||||
|
separator = " "
|
||||||
|
separator-foreground = ${colors.disabled}
|
||||||
|
|
||||||
|
font-0 = Iosevka Term SS08:size=12;4
|
||||||
|
|
||||||
|
modules-left = xworkspaces xwindow
|
||||||
|
modules-center = project pomo
|
||||||
|
modules-right = filesystem pulseaudio memory cpu wlan eth date dunst-snooze xkeyboard battery
|
||||||
|
|
||||||
|
cursor-click = pointer
|
||||||
|
cursor-scroll = ns-resize
|
||||||
|
|
||||||
|
enable-ipc = true
|
||||||
|
|
||||||
|
[module/xworkspaces]
|
||||||
|
type = internal/xworkspaces
|
||||||
|
|
||||||
|
label-active = %name%
|
||||||
|
label-active-background = ${colors.background-alt}
|
||||||
|
label-active-underline= ${colors.primary}
|
||||||
|
label-active-padding = 4pt
|
||||||
|
|
||||||
|
label-occupied = %name%
|
||||||
|
label-occupied-padding = 4pt
|
||||||
|
|
||||||
|
label-urgent = %name%
|
||||||
|
label-urgent-background = ${colors.alert}
|
||||||
|
label-urgent-padding = 4pt
|
||||||
|
|
||||||
|
label-empty = %name%
|
||||||
|
label-empty-foreground = ${colors.disabled}
|
||||||
|
label-empty-padding = 4pt
|
||||||
|
|
||||||
|
[module/xwindow]
|
||||||
|
type = internal/xwindow
|
||||||
|
label = %title:0:60:...%
|
||||||
|
|
||||||
|
[module/filesystem]
|
||||||
|
type = internal/fs
|
||||||
|
interval = 25
|
||||||
|
|
||||||
|
mount-0 = /
|
||||||
|
|
||||||
|
label-mounted = %mountpoint% %percentage_used%%
|
||||||
|
label-unmounted = %mountpoint% not mounted
|
||||||
|
label-unmounted-foreground = ${colors.disabled}
|
||||||
|
|
||||||
|
[module/pulseaudio]
|
||||||
|
type = internal/pulseaudio
|
||||||
|
|
||||||
|
format-volume-prefix = "VOL "
|
||||||
|
format-volume-prefix-foreground = ${colors.primary}
|
||||||
|
format-volume = <label-volume>
|
||||||
|
|
||||||
|
label-volume = %percentage%%
|
||||||
|
|
||||||
|
label-muted = muted
|
||||||
|
label-muted-foreground = ${colors.disabled}
|
||||||
|
|
||||||
|
[module/memory]
|
||||||
|
type = internal/memory
|
||||||
|
interval = 2
|
||||||
|
format-prefix = "RAM "
|
||||||
|
format-prefix-foreground = ${colors.primary}
|
||||||
|
label = %percentage_used:2%%
|
||||||
|
|
||||||
|
[module/cpu]
|
||||||
|
type = internal/cpu
|
||||||
|
interval = 2
|
||||||
|
format-prefix = "CPU "
|
||||||
|
format-prefix-foreground = ${colors.primary}
|
||||||
|
label = %percentage:2%%
|
||||||
|
|
||||||
|
[network-base]
|
||||||
|
type = internal/network
|
||||||
|
interval = 5
|
||||||
|
format-connected = <label-connected>
|
||||||
|
format-disconnected = <label-disconnected>
|
||||||
|
label-disconnected = %ifname% disconnected
|
||||||
|
|
||||||
|
[module/wlan]
|
||||||
|
inherit = network-base
|
||||||
|
interface-type = wireless
|
||||||
|
label-connected = %ifname% %local_ip% %essid%
|
||||||
|
|
||||||
|
[module/eth]
|
||||||
|
inherit = network-base
|
||||||
|
interface-type = wired
|
||||||
|
label-connected = %ifname% %local_ip%
|
||||||
|
|
||||||
|
[module/date]
|
||||||
|
type = internal/date
|
||||||
|
interval = 1
|
||||||
|
date = W%V %d %b %H:%M
|
||||||
|
date-alt = %Y-%m-%d %H:%M:%S
|
||||||
|
label = %date%
|
||||||
|
label-foreground = ${colors.primary}
|
||||||
|
|
||||||
|
[module/pomo]
|
||||||
|
type = custom/script
|
||||||
|
exec = ~/.bin/sb-pomo
|
||||||
|
label-background = #fff
|
||||||
|
interval = 1
|
||||||
|
|
||||||
|
[module/focus-mode]
|
||||||
|
type = custom/script
|
||||||
|
exec = [[ -f /tmp/focus-mode ]] && echo "Focus"
|
||||||
|
label-background = #af0
|
||||||
|
interval = 1
|
||||||
|
|
||||||
|
[module/project]
|
||||||
|
type = custom/script
|
||||||
|
exec = cat ~/.project
|
||||||
|
label-background = #fa0
|
||||||
|
interval = 1000
|
||||||
|
|
||||||
|
[module/xkeyboard]
|
||||||
|
type = internal/xkeyboard
|
||||||
|
label-layout = %name% %variant%
|
||||||
|
blacklist-0 = num lock
|
||||||
|
blacklist-1 = scroll lock
|
||||||
|
|
||||||
|
[module/battery]
|
||||||
|
type = internal/battery
|
||||||
|
full-at = 99
|
||||||
|
low-at = 20
|
||||||
|
battery = BAT0
|
||||||
|
adapter = ADP1
|
||||||
|
poll-interval = 5
|
||||||
|
label-charging = .%percentage%++
|
||||||
|
format-low = <label-low><animation-low>
|
||||||
|
label-discharging = .%percentage%-- %time% %consumption%W
|
||||||
|
animation-low-0 = !
|
||||||
|
animation-low-1 = .
|
||||||
|
animation-low-framerate = 200
|
||||||
|
|
||||||
|
[settings]
|
||||||
|
screenchange-reload = true
|
||||||
|
pseudo-transparency = true
|
||||||
|
|
||||||
|
; vim:ft=dosini
|
|
@ -1,3 +1,15 @@
|
||||||
XDG_DESKTOP_DIR="$HOME"
|
# This file is written by xdg-user-dirs-update
|
||||||
|
# If you want to change or add directories, just edit the line you're
|
||||||
|
# interested in. All local changes will be retained on the next run.
|
||||||
|
# Format is XDG_xxx_DIR="$HOME/yyy", where yyy is a shell-escaped
|
||||||
|
# homedir-relative path, or XDG_xxx_DIR="/yyy", where /yyy is an
|
||||||
|
# absolute path. No other format is supported.
|
||||||
|
#
|
||||||
|
XDG_DESKTOP_DIR="$HOME/"
|
||||||
XDG_DOWNLOAD_DIR="$HOME/dl"
|
XDG_DOWNLOAD_DIR="$HOME/dl"
|
||||||
XDG_DOCUMENTS_DIR="$HOME/doc"
|
XDG_DOCUMENTS_DIR="$HOME/doc"
|
||||||
|
XDG_PUBLICSHARE_DIR="$HOME/"
|
||||||
|
XDG_MUSIC_DIR="$HOME/"
|
||||||
|
XDG_PICTURES_DIR="$HOME/"
|
||||||
|
XDG_TEMPLATES_DIR="$HOME/"
|
||||||
|
XDG_VIDEOS_DIR="$HOME/"
|
||||||
|
|
|
@ -1,6 +1,20 @@
|
||||||
snippet b1r "Red border (1px)"
|
snippet b1(\w+) "Border (1px)" r
|
||||||
border: 1px solid red;
|
`!p
|
||||||
$0
|
import re
|
||||||
|
colors = {
|
||||||
|
'r': 'red',
|
||||||
|
'g': 'green',
|
||||||
|
'b': 'blue',
|
||||||
|
'y': 'yellow',
|
||||||
|
'o': 'orange',
|
||||||
|
'p': 'purple',
|
||||||
|
'c': 'cyan',
|
||||||
|
'm': 'magenta',
|
||||||
|
'w': 'white',
|
||||||
|
}
|
||||||
|
color = colors.get(match.group(1), 'black')
|
||||||
|
snip.rv = f"border: 1px solid {color};"
|
||||||
|
`$0
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
snippet df "Use flexbox layout"
|
snippet df "Use flexbox layout"
|
||||||
|
|
38
.xmobarrc
38
.xmobarrc
|
@ -1,38 +0,0 @@
|
||||||
Config { overrideRedirect = False
|
|
||||||
, font = "Iosevka Term SS08 12"
|
|
||||||
, textOffset = 1
|
|
||||||
, bgColor = "#cccccc"
|
|
||||||
, fgColor = "#111"
|
|
||||||
, position = TopH 20
|
|
||||||
, commands = [ Run Cpu
|
|
||||||
[ "-L", "3"
|
|
||||||
, "-H", "50"
|
|
||||||
, "--high" , "red"
|
|
||||||
] 10
|
|
||||||
, Run Battery [
|
|
||||||
"-t", "<acstatus>〈<left>% <timeleft>〉 ",
|
|
||||||
"--",
|
|
||||||
--"-c", "charge_full",
|
|
||||||
"-O", "AC",
|
|
||||||
"-o", "Bat",
|
|
||||||
"-h", "green",
|
|
||||||
"-l", "red"
|
|
||||||
] 10
|
|
||||||
, Run Alsa "default" "Master"
|
|
||||||
[ "--template", "V〈<volumestatus>〉 "
|
|
||||||
, "--suffix" , "True"
|
|
||||||
, "--"
|
|
||||||
, "--on", ""
|
|
||||||
]
|
|
||||||
, Run Memory ["--template", "Mem: <usedratio>%"] 10
|
|
||||||
, Run Date "W%V %a %b %d %H:%M" "date" 10
|
|
||||||
, Run Com "sb-pomo" [] "pomo" 10
|
|
||||||
, Run Com "sb-anki" [] "anki" 10
|
|
||||||
, Run Com "sb-tasks" [] "tasks" 300
|
|
||||||
, Run Com "sb-project" [] "proj" 300
|
|
||||||
, Run XMonadLog
|
|
||||||
]
|
|
||||||
, sepChar = "%"
|
|
||||||
, alignSep = "}{"
|
|
||||||
, template = "%XMonadLog% %anki% }%pomo% %proj% { %alsa:default:Master% %battery% %date%"
|
|
||||||
}
|
|
|
@ -1,26 +1,26 @@
|
||||||
-- {{{
|
-- {{{ Imports
|
||||||
|
|
||||||
|
import Control.Monad (liftM2)
|
||||||
import XMonad
|
import XMonad
|
||||||
import XMonad.Actions.CopyWindow (copyToAll, killAllOtherCopies)
|
import XMonad.Actions.CopyWindow (copyToAll, killAllOtherCopies)
|
||||||
import XMonad.Actions.FloatSnap
|
import XMonad.Actions.FloatSnap
|
||||||
import Control.Monad (liftM2)
|
|
||||||
import XMonad.Hooks.DynamicProperty
|
|
||||||
import XMonad.Hooks.EwmhDesktops
|
import XMonad.Hooks.EwmhDesktops
|
||||||
import XMonad.Hooks.ManageDocks
|
import XMonad.Hooks.ManageDocks
|
||||||
import XMonad.Hooks.ManageHelpers
|
import XMonad.Hooks.ManageHelpers
|
||||||
|
import XMonad.Hooks.OnPropertyChange (onXPropertyChange)
|
||||||
import XMonad.Hooks.StatusBar
|
import XMonad.Hooks.StatusBar
|
||||||
import XMonad.Hooks.StatusBar.PP
|
import XMonad.Hooks.StatusBar.PP
|
||||||
|
import XMonad.Hooks.WindowSwallowing (swallowEventHook)
|
||||||
import XMonad.Layout.CenteredIfSingle
|
import XMonad.Layout.CenteredIfSingle
|
||||||
import XMonad.Layout.IndependentScreens
|
import XMonad.Layout.IndependentScreens
|
||||||
import XMonad.Layout.PerScreen
|
import XMonad.Layout.PerScreen
|
||||||
import XMonad.Layout.Renamed
|
import XMonad.Layout.Renamed
|
||||||
import XMonad.Layout.ShowWName
|
|
||||||
import XMonad.Layout.ThreeColumns
|
import XMonad.Layout.ThreeColumns
|
||||||
import qualified XMonad.StackSet as W
|
|
||||||
import XMonad.Util.EZConfig
|
import XMonad.Util.EZConfig
|
||||||
import qualified XMonad.Util.Hacks as Hacks
|
|
||||||
import XMonad.Util.Loggers
|
import XMonad.Util.Loggers
|
||||||
import XMonad.Util.Paste
|
import XMonad.Util.Paste
|
||||||
|
import qualified XMonad.StackSet as W
|
||||||
|
import qualified XMonad.Util.Hacks as Hacks
|
||||||
|
|
||||||
-- }}}
|
-- }}}
|
||||||
|
|
||||||
|
@ -67,12 +67,13 @@ shiftAndView = doF . liftM2 (.) W.greedyView W.shift
|
||||||
|
|
||||||
-- Hooks {{{
|
-- Hooks {{{
|
||||||
|
|
||||||
-- startupHook
|
-- startupHook {{{
|
||||||
myStartupHook =
|
myStartupHook =
|
||||||
do
|
do
|
||||||
spawn "killall polybar && polybar -r"
|
spawn "killall polybar && polybar -r"
|
||||||
|
-- }}}
|
||||||
|
|
||||||
-- manageHook
|
-- manageHook {{{
|
||||||
myManageHook :: ManageHook
|
myManageHook :: ManageHook
|
||||||
myManageHook =
|
myManageHook =
|
||||||
composeAll
|
composeAll
|
||||||
|
@ -94,27 +95,19 @@ myManageHook =
|
||||||
className =? "KeePassXC" --> doRectFloat (W.RationalRect 0.1 0.1 0.8 0.8),
|
className =? "KeePassXC" --> doRectFloat (W.RationalRect 0.1 0.1 0.8 0.8),
|
||||||
className =? "flameshot" --> doRectFloat (W.RationalRect 0.1 0.1 0.8 0.8)
|
className =? "flameshot" --> doRectFloat (W.RationalRect 0.1 0.1 0.8 0.8)
|
||||||
]
|
]
|
||||||
|
-- }}}
|
||||||
|
|
||||||
|
-- dynamicManageHook {{{
|
||||||
myDynamicManageHook :: ManageHook
|
myDynamicManageHook :: ManageHook
|
||||||
myDynamicManageHook =
|
myDynamicManageHook =
|
||||||
composeAll
|
composeAll
|
||||||
[
|
[
|
||||||
title =? "Zettelkasten — Firefox Developer Edition" --> doShift "1_sh"
|
title =? "Zettelkasten — Firefox Developer Edition" --> doShift "1_sh"
|
||||||
]
|
]
|
||||||
|
-- }}}
|
||||||
|
|
||||||
-- TODO: Replace showWName by dunst notification
|
-- layoutHook {{{
|
||||||
myShowWNameConfig :: SWNConfig
|
|
||||||
myShowWNameConfig =
|
|
||||||
def
|
|
||||||
{ swn_font = "xft:Iosevka Term SS08:size=16",
|
|
||||||
swn_fade = 0.3,
|
|
||||||
swn_color = "#111111",
|
|
||||||
swn_bgcolor = "#cccccc"
|
|
||||||
}
|
|
||||||
|
|
||||||
-- layoutHook
|
|
||||||
myLayoutHook =
|
myLayoutHook =
|
||||||
showWName' myShowWNameConfig $
|
|
||||||
ifWider smallWidth (
|
ifWider smallWidth (
|
||||||
t ||| -- Tiled layouts
|
t ||| -- Tiled layouts
|
||||||
c3 ||| -- Column layouts
|
c3 ||| -- Column layouts
|
||||||
|
@ -134,6 +127,17 @@ myLayoutHook =
|
||||||
nmaster = 1
|
nmaster = 1
|
||||||
ratio = 1 / 2
|
ratio = 1 / 2
|
||||||
delta = 4 / 100
|
delta = 4 / 100
|
||||||
|
-- }}}
|
||||||
|
|
||||||
|
-- handleEventHook {{{
|
||||||
|
myHandleEventHook =
|
||||||
|
handleEventHook def
|
||||||
|
-- See window swallowing (https://hackage.haskell.org/package/xmonad-contrib-0.18.0/docs/XMonad-Hooks-WindowSwallowing.html)
|
||||||
|
<> swallowEventHook (className =? "Alacritty") (return True)
|
||||||
|
<> onXPropertyChange "WM_NAME" myDynamicManageHook
|
||||||
|
<> Hacks.windowedFullscreenFixEventHook
|
||||||
|
<> hintsEventHook
|
||||||
|
-- }}}
|
||||||
|
|
||||||
-- }}}
|
-- }}}
|
||||||
|
|
||||||
|
@ -143,12 +147,13 @@ myWorkspaces = [ "sh", "www", "dev", "info", "etc" ]
|
||||||
myWorkspaceKeys = [ "a", "s", "d", "f", "g" ]
|
myWorkspaceKeys = [ "a", "s", "d", "f", "g" ]
|
||||||
mySharedWorkspaces = [ "shared" ]
|
mySharedWorkspaces = [ "shared" ]
|
||||||
mySharedWorkspaceKeys = [ "1" ]
|
mySharedWorkspaceKeys = [ "1" ]
|
||||||
|
-- Use Win key instead of Alt
|
||||||
|
myModMask = mod4Mask
|
||||||
|
|
||||||
myConfig =
|
myConfig =
|
||||||
def
|
def
|
||||||
{ terminal = "alacritty",
|
{ terminal = "alacritty",
|
||||||
-- Use Win key instead of Alt
|
modMask = myModMask,
|
||||||
modMask = mod4Mask,
|
|
||||||
workspaces = withScreen 1 myWorkspaces ++ withScreen 2 mySharedWorkspaces,
|
workspaces = withScreen 1 myWorkspaces ++ withScreen 2 mySharedWorkspaces,
|
||||||
-- Styling
|
-- Styling
|
||||||
focusedBorderColor = "#000",
|
focusedBorderColor = "#000",
|
||||||
|
@ -158,7 +163,7 @@ myConfig =
|
||||||
startupHook = myStartupHook,
|
startupHook = myStartupHook,
|
||||||
manageHook = myManageHook <+> manageHook def,
|
manageHook = myManageHook <+> manageHook def,
|
||||||
layoutHook = avoidStruts myLayoutHook,
|
layoutHook = avoidStruts myLayoutHook,
|
||||||
handleEventHook = dynamicPropertyChange "WM_NAME" myDynamicManageHook <> handleEventHook def <> Hacks.windowedFullscreenFixEventHook
|
handleEventHook = myHandleEventHook
|
||||||
}
|
}
|
||||||
`removeKeysP` myRemoveKeys
|
`removeKeysP` myRemoveKeys
|
||||||
`additionalKeysP` myKeys
|
`additionalKeysP` myKeys
|
||||||
|
@ -196,7 +201,10 @@ myKeys =
|
||||||
("M-S-<XF86MonBrightnessDown>", resetTemp), --
|
("M-S-<XF86MonBrightnessDown>", resetTemp), --
|
||||||
("M-S-b", fullscreenBrowser),
|
("M-S-b", fullscreenBrowser),
|
||||||
("<XF86Calculator>", spawnCalculator),
|
("<XF86Calculator>", spawnCalculator),
|
||||||
("<XF86PowerOff>", spawn "systemctl suspend") --TODO: Only enable this on laptop
|
("<XF86PowerOff>", spawn "systemctl suspend"), --TODO: Only enable this on laptop
|
||||||
|
("M-c", windows copyToAll),
|
||||||
|
("M-S-c", killAllOtherCopies),
|
||||||
|
("M-S-<Delete>", kill)
|
||||||
] ++
|
] ++
|
||||||
[ (m ++ k, windows $ f w) |
|
[ (m ++ k, windows $ f w) |
|
||||||
(m, f) <- zip ["M-", "M-S-"]
|
(m, f) <- zip ["M-", "M-S-"]
|
||||||
|
@ -205,9 +213,6 @@ myKeys =
|
||||||
(withScreen 1 myWorkspaces)
|
(withScreen 1 myWorkspaces)
|
||||||
++ zip mySharedWorkspaceKeys
|
++ zip mySharedWorkspaceKeys
|
||||||
(withScreen 2 mySharedWorkspaces)
|
(withScreen 2 mySharedWorkspaces)
|
||||||
("M-c", windows copyToAll),
|
|
||||||
("M-S-c", killAllOtherCopies),
|
|
||||||
("M-S-<Delete>", kill)
|
|
||||||
]
|
]
|
||||||
|
|
||||||
zipKeyPrefixes :: [String] -> [String] -> [String]
|
zipKeyPrefixes :: [String] -> [String] -> [String]
|
||||||
|
@ -242,8 +247,9 @@ spawnKeepassXC = spawn "keepassxc"
|
||||||
fullscreenBrowser :: X ()
|
fullscreenBrowser :: X ()
|
||||||
fullscreenBrowser = spawn "firefox --fullscreen"
|
fullscreenBrowser = spawn "firefox --fullscreen"
|
||||||
|
|
||||||
spawnLauncher :: X ()
|
spawnLauncher, spawnClipManager, spawnCalculator :: X ()
|
||||||
spawnLauncher = spawn "albert toggle"
|
spawnLauncher = spawn "rofi -show drun -show-icons"
|
||||||
|
spawnClipManager = spawn "rofi -modi 'clipboard:greenclip print' -show clipboard -run-command '{cmd}'"
|
||||||
spawnCalculator = spawn "alacritty --class 'Calculator' -e ipython -i /home/h/.bin/calc.py"
|
spawnCalculator = spawn "alacritty --class 'Calculator' -e ipython -i /home/h/.bin/calc.py"
|
||||||
|
|
||||||
printScreen :: X ()
|
printScreen :: X ()
|
||||||
|
|
Loading…
Reference in New Issue