diff options
89 files changed, 3975 insertions, 966 deletions
diff --git a/.Xresources b/.Xresources index 22bb7a4..3ec77a3 100644 --- a/.Xresources +++ b/.Xresources | |||
@@ -10,7 +10,7 @@ Xft.rgba: rgb | |||
10 | Xft.autohint: false | 10 | Xft.autohint: false |
11 | Xft.hintstyle: hintslight | 11 | Xft.hintstyle: hintslight |
12 | Xft.lcdfilter: lcddefault | 12 | Xft.lcdfilter: lcddefault |
13 | Xcursor.size: 32 | 13 | Xcursor.size: 24 |
14 | 14 | ||
15 | ! Copyright (c) 2016-present Arctic Ice Studio <development@arcticicestudio.com> | 15 | ! Copyright (c) 2016-present Arctic Ice Studio <development@arcticicestudio.com> |
16 | ! Copyright (c) 2016-present Sven Greb <code@svengreb.de> | 16 | ! Copyright (c) 2016-present Sven Greb <code@svengreb.de> |
diff --git a/.config/conky/conky.conf##h.luchs b/.config/conky/conky.conf##h.luchs deleted file mode 100644 index f9d1307..0000000 --- a/.config/conky/conky.conf##h.luchs +++ /dev/null | |||
@@ -1,90 +0,0 @@ | |||
1 | conky.config = { | ||
2 | alignment = 'top_left', | ||
3 | background = true, | ||
4 | |||
5 | draw_borders = false, | ||
6 | draw_graph_borders = true, | ||
7 | border_width = 1, | ||
8 | border_outer_margin = 5, | ||
9 | stippled_borders = 6, | ||
10 | |||
11 | cpu_avg_samples = 2, | ||
12 | default_color = 'white', | ||
13 | default_outline_color = '#555', | ||
14 | default_shade_color = 'black', | ||
15 | draw_outline = false, | ||
16 | draw_shades = true, | ||
17 | use_xft = true, | ||
18 | font = 'FuraCode Nerd Font Mono:size=9', | ||
19 | |||
20 | gap_x = 15, | ||
21 | gap_y = 45, | ||
22 | |||
23 | minimum_height = 5, | ||
24 | minimum_width = 5, | ||
25 | net_avg_samples = 2, | ||
26 | no_buffers = true, | ||
27 | out_to_console = false, | ||
28 | out_to_stderr = false, | ||
29 | extra_newline = false, | ||
30 | own_window_hints = "undecorated,below,sticky,skip_taskbar,skip_pager", | ||
31 | own_window_transparent = false, | ||
32 | own_window_argb_visual = true, | ||
33 | own_window_argb_value = 200, | ||
34 | own_window_colour = '282828', | ||
35 | own_window = true, | ||
36 | own_window_class = 'Conky', | ||
37 | own_window_type = "override", | ||
38 | short_units = true, | ||
39 | update_interval = 1.0, | ||
40 | uppercase = false, | ||
41 | use_spacer = 'left', | ||
42 | pad_percents = 2, | ||
43 | show_graph_scale = false, | ||
44 | show_graph_range = false, | ||
45 | double_buffer = true, | ||
46 | |||
47 | color0 = '#e03031', | ||
48 | color2 = '#98971a', | ||
49 | color1 = '#6495ed', | ||
50 | color3 = '#6497b1', | ||
51 | color4 = '#e03031', | ||
52 | color5 = '#22475b', | ||
53 | color6 = '#6497b1', | ||
54 | color7 = '#e03031', | ||
55 | color8 = '#03396c' | ||
56 | } | ||
57 | |||
58 | conky.text = [[ | ||
59 | ${color4}${alignr} | ||
60 | ${color}${alignc}$sysname $kernel on $machine | ||
61 | ${color}${alignc}${exec whoami} @ $nodename | ||
62 | ${color0}$hr${color} | ||
63 | ${alignc}${color1}date ${color}${time %d %B %A} | ||
64 | ${color1}uptime${color} $uptime${alignr}${color1}time ${color}${time %k:%M:%S} | ||
65 | ${color0}temperatures $stippled_hr | ||
66 | ${color1}cpu ${color}${platform coretemp.0/hwmon/hwmon2 temp 1}°C${alignr} ${color1}mobo ${color}${acpitemp}°C | ||
67 | ${color0}processors $stippled_hr${color} | ||
68 | ${cpubar cpu1 6,45} ${freq_g 1}GHz ${cpu cpu1}% ${alignr}${cpubar cpu2 6,45} ${freq_g 2}GHz${alignr}${cpu cpu2}% | ||
69 | ${color0}load $stippled_hr${color} | ||
70 | ${color1}cpu${color} ${cpubar cpu0 6, 120}${alignr}${freq_g}GHz ${cpu cpu0}% | ||
71 | ${color1}ram${color} ${membar 6, 120}${alignr}$mem/$memmax $memperc% | ||
72 | ${color1}swp${color} ${swapbar 6,120}${alignr}$swap/$swapmax $swapperc% | ||
73 | ${color0}filesystem $stippled_hr${color} | ||
74 | ${color1}~ ${color}${FS_BAR 6, 130 /home}${alignr}${fs_used /home} /${fs_size /home} ${color} | ||
75 | ${color0}networking $stippled_hr${color} | ||
76 | ${color1}down${color} ${downspeed enp1s0}/s${alignr}${color1}up${color} ${upspeed enp1s0}/s | ||
77 | ${color}${alignc}${downspeedgraph enp1s0 32,150 2980b9 e74c3c -t}${color} ${upspeedgraph enp1s0 32,150 2980b9 e74c3c -t} | ||
78 | ${color1}address${color} ${addr enp1s0}${alignr}updates ${execi 3600 checkupdates | wc -l} | ||
79 | ${color1}inbound${color} ${tcp_portmon 1 32767 count}${color1} outbound${color} ${tcp_portmon 32768 61000 count}${alignr}${color1}all${color} ${tcp_portmon 1 65535 count} | ||
80 | ${color0}processes $stippled_hr${color} | ||
81 | ${color1}${alignc}name pid cpu% mem% | ||
82 | ${color}${alignc} ${top name 1} ${top pid 1} ${top cpu 1} ${top mem 1} | ||
83 | ${color}${alignc} ${top name 2} ${top pid 2} ${top cpu 2} ${top mem 2} | ||
84 | ${color}${alignc} ${top name 4} ${top pid 4} ${top cpu 4} ${top mem 4} | ||
85 | ${color0}forecast $stippled_hr${color} | ||
86 | ${voffset 05}${texeci 1800 curl -s wttr.in/ank | sed -n '3,7{s/\d27\[[0-9;]*m//g;s/^..//;s/ *$//;p}'} | ||
87 | ${color0}calendar $stippled_hr${color} | ||
88 | ${voffset 05}${execp TODAY=`date +%_d`; cal | tail -n+2 | sed -e '1 s:.*:\${color3}&\${color6}:' -e '1 s:'"$(date +%a |cut -c 1-2)"':\${color4}&\${color5}:' -e '0,/'"$TODAY"'/{s/'"$TODAY"'/\${color7}'"$TODAY"'\${color8}/}' | sed s/^/'${alignc}'/} | ||
89 | ${color4}${alignr} | ||
90 | ]] | ||
diff --git a/.config/efm-langserver/config.yaml b/.config/efm-langserver/config.yaml index 40031b0..77ee931 100644 --- a/.config/efm-langserver/config.yaml +++ b/.config/efm-langserver/config.yaml | |||
@@ -13,7 +13,12 @@ tools: | |||
13 | sh-shfmt: &sh-shfmt | 13 | sh-shfmt: &sh-shfmt |
14 | format-command: 'shfmt -ci -s -bn -i 4 -sr' | 14 | format-command: 'shfmt -ci -s -bn -i 4 -sr' |
15 | format-stdin: true | 15 | format-stdin: true |
16 | tex-fmt-formatter: &tex-fmt-formatter | ||
17 | format-command: 'tex-fmt --tabsize 4 --stdin' | ||
18 | format-stdin: true | ||
16 | languages: | 19 | languages: |
17 | sh: | 20 | sh: |
18 | - <<: *sh-shellcheck | 21 | - <<: *sh-shellcheck |
19 | - <<: *sh-shfmt | 22 | - <<: *sh-shfmt |
23 | tex: | ||
24 | - <<: *tex-fmt-formatter | ||
diff --git a/.config/fish/completions/nvm.fish b/.config/fish/completions/nvm.fish new file mode 100644 index 0000000..14be1b7 --- /dev/null +++ b/.config/fish/completions/nvm.fish | |||
@@ -0,0 +1,21 @@ | |||
1 | complete --command nvm --exclusive | ||
2 | complete --command nvm --exclusive --long version --description "Print version" | ||
3 | complete --command nvm --exclusive --long help --description "Print help" | ||
4 | complete --command nvm --long silent --description "Suppress standard output" | ||
5 | |||
6 | complete --command nvm --exclusive --condition __fish_use_subcommand --arguments install --description "Download and activate the specified Node version" | ||
7 | complete --command nvm --exclusive --condition __fish_use_subcommand --arguments use --description "Activate the specified Node version in the current shell" | ||
8 | complete --command nvm --exclusive --condition __fish_use_subcommand --arguments list --description "List installed Node versions" | ||
9 | complete --command nvm --exclusive --condition __fish_use_subcommand --arguments list-remote --description "List available Node versions to install" | ||
10 | complete --command nvm --exclusive --condition __fish_use_subcommand --arguments current --description "Print the currently-active Node version" | ||
11 | complete --command nvm --exclusive --condition "__fish_seen_subcommand_from install" --arguments "( | ||
12 | test -e $nvm_data && string split ' ' <$nvm_data/.index | ||
13 | )" | ||
14 | complete --command nvm --exclusive --condition "__fish_seen_subcommand_from use" --arguments "(_nvm_list | string split ' ')" | ||
15 | complete --command nvm --exclusive --condition __fish_use_subcommand --arguments uninstall --description "Uninstall the specified Node version" | ||
16 | complete --command nvm --exclusive --condition "__fish_seen_subcommand_from uninstall" --arguments "( | ||
17 | _nvm_list | string split ' ' | string replace system '' | ||
18 | )" | ||
19 | complete --command nvm --exclusive --condition "__fish_seen_subcommand_from use uninstall" --arguments "( | ||
20 | set --query nvm_default_version && echo default | ||
21 | )" | ||
diff --git a/.config/fish/config.fish b/.config/fish/config.fish index adcbe4a..4f7aab8 100644 --- a/.config/fish/config.fish +++ b/.config/fish/config.fish | |||
@@ -23,6 +23,7 @@ set --global --export WECHALLTOKEN "35624-0D38B-A2F16-A98B0-5963D-6DF19" | |||
23 | set --global --export RUST_SRC_PATH (rustc --print sysroot)/lib/rustlib/src/rust/library/ | 23 | set --global --export RUST_SRC_PATH (rustc --print sysroot)/lib/rustlib/src/rust/library/ |
24 | set --global --export NLTK_DATA "$HOME/.local/share/nltk_data" | 24 | set --global --export NLTK_DATA "$HOME/.local/share/nltk_data" |
25 | set --global --export VIRTUALFISH_HOME "$HOME/.local/share/venvs/" | 25 | set --global --export VIRTUALFISH_HOME "$HOME/.local/share/venvs/" |
26 | set --global --export STARDICT_DATA_DIR "$HOME/.local/share/dict/" | ||
26 | 27 | ||
27 | 28 | ||
28 | if status is-interactive | 29 | if status is-interactive |
@@ -31,21 +32,17 @@ if status is-interactive | |||
31 | abbr --add --global bc 'bc -l' | 32 | abbr --add --global bc 'bc -l' |
32 | abbr --add --global bo 'bukuopener' | 33 | abbr --add --global bo 'bukuopener' |
33 | abbr --add --global cp 'cp -i' | 34 | abbr --add --global cp 'cp -i' |
34 | abbr --add --global C 'xsel -b' # Copy to clipboard | ||
35 | abbr --add --global df 'df -h' | 35 | abbr --add --global df 'df -h' |
36 | abbr --add --global free 'free -m' | 36 | abbr --add --global free 'free -m' |
37 | abbr --add --global gst 'git status' | 37 | abbr --add --global gst 'git status' |
38 | abbr --add --global guno 'git status -uno' | 38 | abbr --add --global guno 'git status -uno' |
39 | abbr --add --global inc 'task +in +PENDING count' | 39 | abbr --add --global inc 'task +in +PENDING count' |
40 | abbr --add --global in 'task add +in' | 40 | abbr --add --global in 'task add +in' |
41 | abbr --add --global ledger "ledger -f ~/nextcloud/virtuals/ledger.ledger" | ||
42 | abbr --add --global lim 'nvim /home/yigit/nextcloud/virtuals/ledger.ledger' | ||
43 | abbr --add --global ls 'exa' | 41 | abbr --add --global ls 'exa' |
44 | abbr --add --global maybe 'task due:someday list' | 42 | abbr --add --global maybe 'task due:someday list' |
45 | abbr --add --global music 'mpv --no-vid' | 43 | abbr --add --global music 'mpv --no-vid' |
46 | abbr --add --global mv 'mv -i' | 44 | abbr --add --global mv 'mv -i' |
47 | abbr --add --global nt 'neomutt' | 45 | abbr --add --global nt 'neomutt' |
48 | abbr --add --global report "report -f ~/nextcloud/virtuals/ledger.ledger" | ||
49 | abbr --add --global re 'remi -gaad -@2' | 46 | abbr --add --global re 'remi -gaad -@2' |
50 | abbr --add --global rm 'rm -i' | 47 | abbr --add --global rm 'rm -i' |
51 | abbr --add --global s "du -hs * | sort -rh | head -5" | 48 | abbr --add --global s "du -hs * | sort -rh | head -5" |
@@ -60,9 +57,19 @@ if status is-interactive | |||
60 | abbr --add --global wim 'nvim /home/yigit/nextcloud/personal_wiki/text/index.wiki' | 57 | abbr --add --global wim 'nvim /home/yigit/nextcloud/personal_wiki/text/index.wiki' |
61 | abbr --add --global yst 'yadm status' | 58 | abbr --add --global yst 'yadm status' |
62 | abbr --add --global dr 'dragon-drop' | 59 | abbr --add --global dr 'dragon-drop' |
60 | abbr --add --global ddg 'surfraw duckduckgo -j' | ||
61 | abbr --add --global lu 'sdcv' | ||
62 | |||
63 | if test "$WAYLAND_DISPLAY" = "wayland-1" | ||
64 | abbr --add --global C 'wl-copy' # Wayland | ||
65 | else | ||
66 | abbr --add --global C 'xsel -b' # X11 | ||
67 | end | ||
63 | 68 | ||
64 | zoxide init fish | source | 69 | zoxide init fish | source |
65 | direnv hook fish | source | 70 | direnv hook fish | source |
71 | fzf --fish | source | ||
72 | atuin init fish --disable-up-arrow | source | ||
66 | 73 | ||
67 | fish_ssh_agent | 74 | fish_ssh_agent |
68 | end | 75 | end |
diff --git a/.config/fish/fish_plugins b/.config/fish/fish_plugins new file mode 100644 index 0000000..49bfe20 --- /dev/null +++ b/.config/fish/fish_plugins | |||
@@ -0,0 +1,2 @@ | |||
1 | jorgebucaran/nvm.fish | ||
2 | franciscolourenco/done | ||
diff --git a/.config/fish/fish_variables b/.config/fish/fish_variables index e8b58fb..b32dfe3 100644 --- a/.config/fish/fish_variables +++ b/.config/fish/fish_variables | |||
@@ -2,6 +2,10 @@ | |||
2 | # VERSION: 3.0 | 2 | # VERSION: 3.0 |
3 | SETUVAR __fish_initialized:3400 | 3 | SETUVAR __fish_initialized:3400 |
4 | SETUVAR _fish_abbr_dr:dragon\x2ddrop | 4 | SETUVAR _fish_abbr_dr:dragon\x2ddrop |
5 | SETUVAR _fisher_franciscolourenco_2F_done_files:\x7e/\x2econfig/fish/conf\x2ed/done\x2efish | ||
6 | SETUVAR _fisher_jorgebucaran_2F_nvm_2E_fish_files:\x7e/\x2econfig/fish/functions/_nvm_index_update\x2efish\x1e\x7e/\x2econfig/fish/functions/_nvm_list\x2efish\x1e\x7e/\x2econfig/fish/functions/_nvm_version_activate\x2efish\x1e\x7e/\x2econfig/fish/functions/_nvm_version_deactivate\x2efish\x1e\x7e/\x2econfig/fish/functions/nvm\x2efish\x1e\x7e/\x2econfig/fish/conf\x2ed/nvm\x2efish\x1e\x7e/\x2econfig/fish/completions/nvm\x2efish | ||
7 | SETUVAR _fisher_plugins:jorgebucaran/nvm\x2efish\x1efranciscolourenco/done | ||
8 | SETUVAR _fisher_upgraded_to_4_4:\x1d | ||
5 | SETUVAR fish_color_autosuggestion:6c7086 | 9 | SETUVAR fish_color_autosuggestion:6c7086 |
6 | SETUVAR fish_color_cancel:f38ba8 | 10 | SETUVAR fish_color_cancel:f38ba8 |
7 | SETUVAR fish_color_command:89b4fa | 11 | SETUVAR fish_color_command:89b4fa |
diff --git a/.config/fish/functions/fish_right_prompt.fish b/.config/fish/functions/fish_right_prompt.fish index 5963ed9..1e28dfc 100644 --- a/.config/fish/functions/fish_right_prompt.fish +++ b/.config/fish/functions/fish_right_prompt.fish | |||
@@ -76,6 +76,11 @@ function fish_right_prompt --description 'Write out the right prompt' | |||
76 | set virtualenv "$green 🐍 " (basename "$VIRTUAL_ENV") | 76 | set virtualenv "$green 🐍 " (basename "$VIRTUAL_ENV") |
77 | end | 77 | end |
78 | 78 | ||
79 | set -l node_version | ||
80 | if set -q nvm_current_version | ||
81 | set node_version "$red " "$nvm_current_version" | ||
82 | end | ||
83 | |||
79 | set hour $blue(date '+%R') | 84 | set hour $blue(date '+%R') |
80 | echo -n -s $virtualenv ' ' $repo_info ' ' $hour | 85 | echo -n -s $node_version ' ' $virtualenv ' ' $repo_info ' ' $hour |
81 | end | 86 | end |
diff --git a/.config/fish/functions/fish_user_key_bindings.fish b/.config/fish/functions/fish_user_key_bindings.fish deleted file mode 100644 index ff0d9f3..0000000 --- a/.config/fish/functions/fish_user_key_bindings.fish +++ /dev/null | |||
@@ -1,3 +0,0 @@ | |||
1 | function fish_user_key_bindings | ||
2 | fzf_key_bindings | ||
3 | end | ||
diff --git a/.config/fish/functions/sessiontype.fish b/.config/fish/functions/sessiontype.fish new file mode 100644 index 0000000..33830ca --- /dev/null +++ b/.config/fish/functions/sessiontype.fish | |||
@@ -0,0 +1,8 @@ | |||
1 | # https://unix.stackexchange.com/questions/202891/how-to-know-whether-wayland-or-x11-is-being-used/371164#comment573431_325972 | ||
2 | |||
3 | function sessiontype | ||
4 | # https://unix.stackexchange.com/questions/202891/how-to-know-whether-wayland-or-x11-is-being-used/371164#comment573431_325972 | ||
5 | # have to run it first? | ||
6 | loginctl > /dev/null | ||
7 | loginctl show-session (loginctl | awk '/tty/ {print $1}') -p Type | awk -F= '{print $2}' | ||
8 | end | ||
diff --git a/.config/hypr/conf/autostart.conf b/.config/hypr/conf/autostart.conf new file mode 100644 index 0000000..b8792f1 --- /dev/null +++ b/.config/hypr/conf/autostart.conf | |||
@@ -0,0 +1,39 @@ | |||
1 | # See https://wiki.hyprland.org/Configuring/Keywords/#executing | ||
2 | # autostart | ||
3 | |||
4 | # Setup XDG for screen sharing | ||
5 | exec-once = ~/.local/bin/xdg.sh | ||
6 | |||
7 | # Polkit | ||
8 | exec-once = /usr/lib/polkit-kde-authentication-agent-1 | ||
9 | |||
10 | # Sway Notification Center | ||
11 | exec-once = swaync | ||
12 | |||
13 | # Polybar | ||
14 | exec-once = waybar | ||
15 | |||
16 | # Dropbox | ||
17 | exec-once = nextcloud --background | ||
18 | |||
19 | # Clipboard Manager | ||
20 | exec-once = copyq --start-server | ||
21 | |||
22 | # Wallpaper | ||
23 | exec-once = hyprpaper | ||
24 | |||
25 | # Daily Reminders | ||
26 | exec-once = remind -z -k'notify-send --app-name="remind" --icon="fcitx-remind-active" "⏰ reminder!" "%s" &' ~/.reminders | ||
27 | |||
28 | # Start playerctl daemon, spotify/youtube etc. binder | ||
29 | exec-once = playerctld daemon | ||
30 | |||
31 | # For hyprshade scheduling, f.lux | ||
32 | exec-once = dbus-update-activation-environment --systemd HYPRLAND_INSTANCE_SIGNATURE | ||
33 | exec-once = hyprshade auto | ||
34 | |||
35 | # Network Manager Applet | ||
36 | exec-once = nm-applet | ||
37 | |||
38 | # Cursor | ||
39 | exec-once = hyprctl setcursor capitaine-cursors-light 28 | ||
diff --git a/.config/hypr/conf/keybinds.conf b/.config/hypr/conf/keybinds.conf new file mode 100644 index 0000000..82b26ba --- /dev/null +++ b/.config/hypr/conf/keybinds.conf | |||
@@ -0,0 +1,96 @@ | |||
1 | # Key bindings | ||
2 | |||
3 | # See https://wiki.hyprland.org/Configuring/Keywords/ | ||
4 | $mainMod = SUPER | ||
5 | $terminal = kitty | ||
6 | $fileManager = thunar | ||
7 | $menu = tofi-drun | xargs hyprctl dispatch exec -- | ||
8 | |||
9 | # Applications | ||
10 | bind = $mainMod+SHIFT, code:41, exec, $fileManager # f | ||
11 | bind = $mainMod, RETURN, exec, $terminal | ||
12 | bind = $mainMod, code:71, exec, $HOME/.local/bin/mailsync # f5 | ||
13 | bind = ,code:118, exec, copyq menu # ins | ||
14 | bind = $mainMod, 0, exec, swaync-client --hide-latest | ||
15 | bind = $mainMod+SHIFT, 0, exec, swaync-client -t | ||
16 | bindr = SUPER+SHIFT, escape, exec, wlogout | ||
17 | bindr = $mainMod, code:42, exec, $HOME/.local/bin/done # g | ||
18 | bindr = $mainMod, code:30, exec, $HOME/.local/bin/bukuadd_c # u | ||
19 | bindr = $mainMod, code:35, exec, $HOME/.local/bin/td # ] | ||
20 | |||
21 | bind = $mainMod+SHIFT, code:24, killactive, # q | ||
22 | bind = $mainMod, code:55, togglefloating, # v | ||
23 | bind = $mainMod, code:40, exec, $menu # d | ||
24 | bind = $mainMod, code:27, pseudo, # p, dwindle | ||
25 | bind = $mainMod, code:26, togglesplit, # e, dwindle | ||
26 | bind = $mainMod, code:41, fullscreen, 2 # f | ||
27 | |||
28 | bindl = , XF86AudioPlay, exec, playerctl play-pause | ||
29 | bindl = , XF86AudioNext, exec, playerctl next | ||
30 | bindl = , XF86AudioPrev, exec, playerctl previous | ||
31 | |||
32 | # Screenshots: | ||
33 | # Super+P: Current window | ||
34 | # Super+Shift+p: Select area | ||
35 | # Super+Alt+p Current output | ||
36 | # Super+Ctrl+p All outputs | ||
37 | |||
38 | # Optionally, customize slurp's appearance | ||
39 | env = SLURP_ARGS, -d -B F050F022 -b 10101022 -c ff00ff | ||
40 | |||
41 | bind = SHIFT, Print, exec, grimblast copysave area | ||
42 | bind = ,Print, exec, grimblast copy area | ||
43 | |||
44 | # Move focus | ||
45 | bind = $mainMod, code:43, movefocus, l | ||
46 | bind = $mainMod, code:44, movefocus, d | ||
47 | bind = $mainMod, code:45, movefocus, u | ||
48 | bind = $mainMod, code:46, movefocus, r | ||
49 | |||
50 | # Move window | ||
51 | bind = $mainMod+SHIFT, code:43, movewindow, l | ||
52 | bind = $mainMod+SHIFT, code:44, movewindow, d | ||
53 | bind = $mainMod+SHIFT, code:45, movewindow, u | ||
54 | bind = $mainMod+SHIFT, code:46, movewindow, r | ||
55 | |||
56 | # Switch workspaces with mainMod + [0-9] | ||
57 | bind = $mainMod, 1, workspace, 1 | ||
58 | bind = $mainMod, 2, workspace, 2 | ||
59 | bind = $mainMod, 3, workspace, 3 | ||
60 | bind = $mainMod, 4, workspace, 4 | ||
61 | bind = $mainMod, 5, workspace, 5 | ||
62 | bind = $mainMod, 6, workspace, 6 | ||
63 | bind = $mainMod, 7, workspace, 7 | ||
64 | bind = $mainMod, 8, workspace, 8 | ||
65 | bind = $mainMod, 9, workspace, 9 | ||
66 | bind = $mainMod, code:21, workspace, name:browser | ||
67 | bind = $mainMod, code:49, workspace, name:zotero | ||
68 | bind = $mainMod, code:60, workspace, name:desktop | ||
69 | bind = $mainMod, code:59, workspace, name:console | ||
70 | bind = $mainMod, code:58, workspace, name:music | ||
71 | |||
72 | # Example special workspace (scratchpad) | ||
73 | bind = $mainMod, code:20, togglespecialworkspace, magic # - | ||
74 | bind = $mainMod SHIFT, code:20, movetoworkspace, special:magic | ||
75 | |||
76 | # Move active window to a workspace with mainMod + SHIFT + [0-9] | ||
77 | bind = $mainMod SHIFT, 1, movetoworkspace, 1 | ||
78 | bind = $mainMod SHIFT, 2, movetoworkspace, 2 | ||
79 | bind = $mainMod SHIFT, 3, movetoworkspace, 3 | ||
80 | bind = $mainMod SHIFT, 4, movetoworkspace, 4 | ||
81 | bind = $mainMod SHIFT, 5, movetoworkspace, 5 | ||
82 | bind = $mainMod SHIFT, 6, movetoworkspace, 6 | ||
83 | bind = $mainMod SHIFT, 7, movetoworkspace, 7 | ||
84 | bind = $mainMod SHIFT, 8, movetoworkspace, 8 | ||
85 | bind = $mainMod SHIFT, 9, movetoworkspace, 9 | ||
86 | bind = $mainMod SHIFT, code:21, movetoworkspace, name:browser | ||
87 | bind = $mainMod SHIFT, code:49, movetoworkspace, name:zotero | ||
88 | bind = $mainMod SHIFT, code:60, movetoworkspace, name:desktop | ||
89 | bind = $mainMod SHIFT, code:59, movetoworkspace, name:console | ||
90 | bind = $mainMod SHIFT, code:58, movetoworkspace, name:music | ||
91 | |||
92 | # Move/resize windows with mainMod + LMB/RMB and dragging | ||
93 | bindm = $mainMod, mouse:272, movewindow | ||
94 | bindm = $mainMod, mouse:273, resizewindow | ||
95 | |||
96 | bindl=,switch:Lid Switch, exec, ~/.config/hypr/scripts/switch.sh | ||
diff --git a/.config/hypr/conf/monitor.conf b/.config/hypr/conf/monitor.conf new file mode 100644 index 0000000..e04dfb1 --- /dev/null +++ b/.config/hypr/conf/monitor.conf | |||
@@ -0,0 +1,5 @@ | |||
1 | # qualle monitor | ||
2 | monitor=eDP-1,highres,auto,1 | ||
3 | |||
4 | # # autoconfig any additional monitor | ||
5 | monitor=HDMI-A-1,highres,auto-up,1.25 | ||
diff --git a/.config/hypr/conf/sound_brightness_notifications.conf b/.config/hypr/conf/sound_brightness_notifications.conf new file mode 100644 index 0000000..e198237 --- /dev/null +++ b/.config/hypr/conf/sound_brightness_notifications.conf | |||
@@ -0,0 +1,9 @@ | |||
1 | bind = , XF86MonBrightnessUp, exec, lightctl up | ||
2 | bind = , XF86MonBrightnessDown, exec, lightctl down | ||
3 | |||
4 | bindl = , XF86AudioMicMute, exec, volumectl -m toggle-mute | ||
5 | bindl = , XF86AudioMute, exec, volumectl toggle-mute | ||
6 | bindle = , XF86AudioRaiseVolume, exec, volumectl -u up | ||
7 | bindle = , XF86AudioLowerVolume, exec, volumectl -u down | ||
8 | |||
9 | exec-once = avizo-service | ||
diff --git a/.config/hypr/conf/windowrules.conf b/.config/hypr/conf/windowrules.conf new file mode 100644 index 0000000..215b012 --- /dev/null +++ b/.config/hypr/conf/windowrules.conf | |||
@@ -0,0 +1,79 @@ | |||
1 | # See https://wiki.hyprland.org/Configuring/Window-Rules/ | ||
2 | windowrulev2 = suppressevent maximize, class:.* | ||
3 | |||
4 | # polkit auth agent | ||
5 | windowrulev2 = float, class:org.kde.polkit-kde-authentication-agent-1 | ||
6 | |||
7 | # yad | ||
8 | windowrulev2 = float, class:yad | ||
9 | |||
10 | # Libre Office | ||
11 | windowrulev2 = size 800 600, class:soffice,title:Export | ||
12 | |||
13 | # Blueman | ||
14 | windowrulev2 = float,class:^(blueman-manager)$ | ||
15 | |||
16 | # NetworkManager | ||
17 | windowrulev2 = float,class:^(nm-connection-editor)$ | ||
18 | |||
19 | # Pavucontrol | ||
20 | windowrulev2 = float,class:^(org.pulseaudio.pavucontrol)$ | ||
21 | windowrulev2 = size 800 600,class:^(org.pulseaudio.pavucontrol)$ | ||
22 | |||
23 | # copyq | ||
24 | windowrulev2 = float, class:com.github.hluk.copyq | ||
25 | windowrulev2 = noborder, class:com.github.hluk.copyq | ||
26 | windowrulev2 = noblur, class:com.github.hluk.copyq | ||
27 | windowrulev2 = dimaround, class:com.github.hluk.copyq | ||
28 | windowrulev2 = move 70% 10%, class:com.github.hluk.copyq | ||
29 | |||
30 | # Firefox | ||
31 | windowrulev2 = workspace name:browser silent, class:firefox | ||
32 | |||
33 | # Browser Picture in Picture | ||
34 | windowrulev2 = float, title:^(Picture-in-Picture)$ | ||
35 | windowrulev2 = pin, title:^(Picture-in-Picture)$ | ||
36 | windowrulev2 = move 72% 40%, title:^(Picture-in-Picture)$ | ||
37 | windowrulev2 = size 520 390, title:^(Picture-in-Picture)$ | ||
38 | |||
39 | # Discord Popout | ||
40 | windowrulev2 = float, title:^(Discord Popout)$ | ||
41 | windowrulev2 = pin, title:^(Discord Popout)$ | ||
42 | windowrulev2 = move 72% 40%, title:^(Discord Popout)$ | ||
43 | windowrulev2 = size 573 354, title:^(Discord Popout)$ | ||
44 | |||
45 | # Xwaylandvideobridge | ||
46 | windowrulev2 = opacity 0.0 override,class:^(xwaylandvideobridge)$ | ||
47 | windowrulev2 = noanim,class:^(xwaylandvideobridge)$ | ||
48 | windowrulev2 = noinitialfocus,class:^(xwaylandvideobridge)$ | ||
49 | windowrulev2 = maxsize 1 1,class:^(xwaylandvideobridge)$ | ||
50 | windowrulev2 = noblur,class:^(xwaylandvideobridge)$ | ||
51 | |||
52 | # Zotero | ||
53 | windowrulev2 = workspace name:zotero silent, class:Zotero | ||
54 | |||
55 | windowrulev2 = float, class:^(Zotero)$,title:^(Progress)$ | ||
56 | windowrulev2 = noinitialfocus, class:^(Zotero)$,title:^(Progress)$ | ||
57 | windowrulev2 = move 1579 954, class:^(Zotero)$,title:^(Progress)$ | ||
58 | windowrulev2 = size 300 72, class:^(Zotero)$,title:^(Progress)$ | ||
59 | windowrulev2 = size 445 195, class:^(Zotero)$,title:^(New Collection)$ | ||
60 | |||
61 | # Thunar | ||
62 | windowrulev2 = float, class:^(Thunar)$,title:^(File Operation Progress)$ | ||
63 | windowrulev2 = noinitialfocus, class:^(Thunar)$,title:^(File Operation Progress)$ | ||
64 | windowrulev2 = size 505 100, class:^(Thunar)$,title:^(File Operation Progress)$ | ||
65 | |||
66 | # engrampa | ||
67 | windowrulev2 = float, class:^(engrampa)$,title:^(Extract archive)$ | ||
68 | |||
69 | # Spotify | ||
70 | windowrulev2 = workspace name:music silent, class:^(Spotify)$ | ||
71 | |||
72 | # Thunderbird | ||
73 | windowrulev2 = float, class:^(thunderbird)$,title:^(Edit Item)$ | ||
74 | windowrulev2 = size 720 790, class:^(thunderbird)$,title:^(Edit Item)$ | ||
75 | windowrulev2 = float, class:^(thunderbird)$,title:^(TbSync account manager)$ | ||
76 | windowrulev2 = size 1100 880, class:^(thunderbird)$,title:^(Edit Item)$ | ||
77 | |||
78 | # Zoom | ||
79 | windowrulev2=stayfocused,class:(zoom),initialTitle:(menu window) | ||
diff --git a/.config/hypr/hyprland.conf b/.config/hypr/hyprland.conf new file mode 100644 index 0000000..516432d --- /dev/null +++ b/.config/hypr/hyprland.conf | |||
@@ -0,0 +1,124 @@ | |||
1 | # hyprland config | ||
2 | # https://wiki.hyprland.org/ | ||
3 | |||
4 | source = ~/.config/hypr/conf/monitor.conf | ||
5 | |||
6 | source = ~/.config/hypr/conf/autostart.conf | ||
7 | |||
8 | source = ~/.config/hypr/conf/keybinds.conf | ||
9 | |||
10 | source = ~/.config/hypr/conf/sound_brightness_notifications.conf | ||
11 | |||
12 | source = ~/.config/hypr/conf/windowrules.conf | ||
13 | |||
14 | # Some default env vars. | ||
15 | env = GDK_BACKEND,wayland,x11,* | ||
16 | env = QT_QPA_PLATFORM,wayland;xcb | ||
17 | env = CLUTTER_BACKEND,wayland | ||
18 | env = XDG_CURRENT_DESKTOP,Hyprland | ||
19 | env = XDG_SESSION_TYPE,wayland | ||
20 | env = XDG_SESSION_DESKTOP,Hyprland | ||
21 | |||
22 | env = QT_AUTO_SCREEN_SCALE_FACTOR,1 - (From the Qt documentation) enables automatic scaling, based on the monitor’s pixel density | ||
23 | env = QT_QPA_PLATFORM,wayland;xcb - Tell Qt applications to use the Wayland backend, and fall back to x11 if Wayland is unavailable | ||
24 | env = QT_WAYLAND_DISABLE_WINDOWDECORATION,1 - Disables window decorations on Qt applications | ||
25 | env = QT_QPA_PLATFORMTHEME,qt5ct - Tells Qt based applications to pick your theme from qt5ct, use with Kvantum. | ||
26 | |||
27 | env = XCURSOR_SIZE,24 | ||
28 | env = QT_QPA_PLATFORMTHEME,qt6ct # change to qt6ct if you have that | ||
29 | env = SEMESTER_THEME,you got this | ||
30 | |||
31 | # For all categories, see https://wiki.hyprland.org/Configuring/Variables/ | ||
32 | input { | ||
33 | kb_layout = us | ||
34 | kb_variant = colemak | ||
35 | kb_model = | ||
36 | kb_options = | ||
37 | kb_rules = | ||
38 | numlock_by_default = true | ||
39 | |||
40 | follow_mouse = 1 | ||
41 | |||
42 | touchpad { | ||
43 | natural_scroll = true | ||
44 | } | ||
45 | |||
46 | sensitivity = 0 # -1.0 - 1.0, 0 means no modification. | ||
47 | } | ||
48 | |||
49 | general { | ||
50 | # See https://wiki.hyprland.org/Configuring/Variables/ | ||
51 | |||
52 | gaps_in = 3 | ||
53 | gaps_out = 6 | ||
54 | border_size = 2 | ||
55 | col.active_border = rgba(33ccffee) rgba(00ff99ee) 45deg | ||
56 | col.inactive_border = rgba(595959aa) | ||
57 | |||
58 | layout = dwindle | ||
59 | |||
60 | # Please see https://wiki.hyprland.org/Configuring/Tearing/ before you turn this on | ||
61 | allow_tearing = false | ||
62 | } | ||
63 | |||
64 | decoration { | ||
65 | # See https://wiki.hyprland.org/Configuring/Variables/ | ||
66 | |||
67 | rounding = 0 | ||
68 | |||
69 | blur { | ||
70 | enabled = true | ||
71 | size = 20 | ||
72 | passes = 1 | ||
73 | } | ||
74 | |||
75 | shadow { | ||
76 | enabled = true | ||
77 | range = 4 | ||
78 | render_power = 3 | ||
79 | color = rgba(1a1a1aee) | ||
80 | } | ||
81 | } | ||
82 | |||
83 | animations { | ||
84 | enabled = yes | ||
85 | |||
86 | # Some default animations, see https://wiki.hyprland.org/Configuring/Animations/ | ||
87 | |||
88 | bezier = myBezier, 0.05, 0.9, 0.1, 1.05 | ||
89 | |||
90 | animation = windows, 1, 7, myBezier | ||
91 | animation = windowsOut, 1, 7, default, popin 80% | ||
92 | animation = border, 1, 10, default | ||
93 | animation = borderangle, 1, 8, default | ||
94 | animation = fade, 1, 7, default | ||
95 | animation = workspaces, 1, 6, default | ||
96 | } | ||
97 | |||
98 | dwindle { | ||
99 | # See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ | ||
100 | pseudotile = yes # master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below | ||
101 | preserve_split = yes # you probably want this | ||
102 | } | ||
103 | |||
104 | master { | ||
105 | # See https://wiki.hyprland.org/Configuring/Master-Layout/ | ||
106 | new_status = master | ||
107 | } | ||
108 | |||
109 | gestures { | ||
110 | # See https://wiki.hyprland.org/Configuring/Variables/ | ||
111 | workspace_swipe = on | ||
112 | } | ||
113 | |||
114 | misc { | ||
115 | # See https://wiki.hyprland.org/Configuring/Variables/ | ||
116 | force_default_wallpaper = 0 # Set to 0 or 1 to disable the anime mascot wallpapers | ||
117 | } | ||
118 | |||
119 | binds { | ||
120 | workspace_back_and_forth = true | ||
121 | } | ||
122 | |||
123 | |||
124 | exec-once=dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP # https://gist.github.com/brunoanc/2dea6ddf6974ba4e5d26c3139ffb7580#editing-the-configuration-file | ||
diff --git a/.config/hypr/hyprlock.conf b/.config/hypr/hyprlock.conf new file mode 100644 index 0000000..1b6ebe1 --- /dev/null +++ b/.config/hypr/hyprlock.conf | |||
@@ -0,0 +1,88 @@ | |||
1 | source = $HOME/.config/hypr/mocha.conf | ||
2 | |||
3 | $accent = $mauve | ||
4 | $accentAlpha = $mauveAlpha | ||
5 | $font = Iosevka Aile | ||
6 | |||
7 | # GENERAL | ||
8 | general { | ||
9 | disable_loading_bar = true | ||
10 | hide_cursor = true | ||
11 | } | ||
12 | |||
13 | # BACKGROUND | ||
14 | background { | ||
15 | monitor = | ||
16 | path = $HOME/desk/pics/lockscreen.jpg | ||
17 | blur_passes = 0 | ||
18 | color = $base | ||
19 | } | ||
20 | |||
21 | # TIME | ||
22 | label { | ||
23 | monitor = | ||
24 | text = cmd[update:1000] date +"%H:%M" | ||
25 | color = $text | ||
26 | font_size = 90 | ||
27 | font_family = $font | ||
28 | position = -30, 0 | ||
29 | halign = right | ||
30 | valign = top | ||
31 | } | ||
32 | |||
33 | # DATE | ||
34 | label { | ||
35 | monitor = | ||
36 | text = cmd[update:43200000] date +"%A, %d %B %Y" | ||
37 | color = $text | ||
38 | font_size = 25 | ||
39 | font_family = $font | ||
40 | position = -30, -150 | ||
41 | halign = right | ||
42 | valign = top | ||
43 | } | ||
44 | |||
45 | # USER AVATAR | ||
46 | image { | ||
47 | monitor = | ||
48 | path = $HOME/desk/pics/big_cat_hi.jpeg | ||
49 | size = 100 | ||
50 | border_color = $accent | ||
51 | position = 0, 75 | ||
52 | halign = center | ||
53 | valign = center | ||
54 | } | ||
55 | |||
56 | # INPUT FIELD | ||
57 | input-field { | ||
58 | monitor = | ||
59 | size = 300, 60 | ||
60 | outline_thickness = 4 | ||
61 | dots_size = 0.2 | ||
62 | dots_spacing = 0.2 | ||
63 | dots_center = true | ||
64 | outer_color = $accent | ||
65 | inner_color = $surface0 | ||
66 | font_color = $text | ||
67 | fade_on_empty = false | ||
68 | placeholder_text = <span foreground="##$textAlpha"><i> logged in as </i><span foreground="##$accentAlpha">$USER</span></span> | ||
69 | hide_input = false | ||
70 | check_color = $accent | ||
71 | fail_color = $red | ||
72 | fail_text = <i>$FAIL <b>($ATTEMPTS)</b></i> | ||
73 | capslock_color = $yellow | ||
74 | position = 0, -47 | ||
75 | halign = center | ||
76 | valign = center | ||
77 | } | ||
78 | |||
79 | label { | ||
80 | monitor = | ||
81 | text = no place like home | ||
82 | color = $text_color | ||
83 | font_size = 20 | ||
84 | font_family = $font_family | ||
85 | position = 30, -30 | ||
86 | halign = left | ||
87 | valign = top | ||
88 | } | ||
diff --git a/.config/hypr/hyprpaper.conf b/.config/hypr/hyprpaper.conf new file mode 100644 index 0000000..dd3aa91 --- /dev/null +++ b/.config/hypr/hyprpaper.conf | |||
@@ -0,0 +1,5 @@ | |||
1 | preload = $HOME/desk/pics/vodka_fareler.jpg | ||
2 | preload = /home/yigit/desk/pics/lightcircle.jpg | ||
3 | wallpaper = eDP-1,$HOME/desk/pics/vodka_fareler.jpg | ||
4 | wallpaper = HDMI-A-1,$HOME/desk/pics/lightcircle.jpg | ||
5 | splash = false | ||
diff --git a/.config/hypr/hyprshade.toml b/.config/hypr/hyprshade.toml new file mode 100644 index 0000000..c8024e3 --- /dev/null +++ b/.config/hypr/hyprshade.toml | |||
@@ -0,0 +1,4 @@ | |||
1 | [[shades]] | ||
2 | name = "blue-light-filter" | ||
3 | start_time = 19:00:00 | ||
4 | end_time = 06:00:00 | ||
diff --git a/.config/hypr/mocha.conf b/.config/hypr/mocha.conf new file mode 100644 index 0000000..2b80922 --- /dev/null +++ b/.config/hypr/mocha.conf | |||
@@ -0,0 +1,77 @@ | |||
1 | $rosewater = rgb(f5e0dc) | ||
2 | $rosewaterAlpha = f5e0dc | ||
3 | |||
4 | $flamingo = rgb(f2cdcd) | ||
5 | $flamingoAlpha = f2cdcd | ||
6 | |||
7 | $pink = rgb(f5c2e7) | ||
8 | $pinkAlpha = f5c2e7 | ||
9 | |||
10 | $mauve = rgb(cba6f7) | ||
11 | $mauveAlpha = cba6f7 | ||
12 | |||
13 | $red = rgb(f38ba8) | ||
14 | $redAlpha = f38ba8 | ||
15 | |||
16 | $maroon = rgb(eba0ac) | ||
17 | $maroonAlpha = eba0ac | ||
18 | |||
19 | $peach = rgb(fab387) | ||
20 | $peachAlpha = fab387 | ||
21 | |||
22 | $yellow = rgb(f9e2af) | ||
23 | $yellowAlpha = f9e2af | ||
24 | |||
25 | $green = rgb(a6e3a1) | ||
26 | $greenAlpha = a6e3a1 | ||
27 | |||
28 | $teal = rgb(94e2d5) | ||
29 | $tealAlpha = 94e2d5 | ||
30 | |||
31 | $sky = rgb(89dceb) | ||
32 | $skyAlpha = 89dceb | ||
33 | |||
34 | $sapphire = rgb(74c7ec) | ||
35 | $sapphireAlpha = 74c7ec | ||
36 | |||
37 | $blue = rgb(89b4fa) | ||
38 | $blueAlpha = 89b4fa | ||
39 | |||
40 | $lavender = rgb(b4befe) | ||
41 | $lavenderAlpha = b4befe | ||
42 | |||
43 | $text = rgb(cdd6f4) | ||
44 | $textAlpha = cdd6f4 | ||
45 | |||
46 | $subtext1 = rgb(bac2de) | ||
47 | $subtext1Alpha = bac2de | ||
48 | |||
49 | $subtext0 = rgb(a6adc8) | ||
50 | $subtext0Alpha = a6adc8 | ||
51 | |||
52 | $overlay2 = rgb(9399b2) | ||
53 | $overlay2Alpha = 9399b2 | ||
54 | |||
55 | $overlay1 = rgb(7f849c) | ||
56 | $overlay1Alpha = 7f849c | ||
57 | |||
58 | $overlay0 = rgb(6c7086) | ||
59 | $overlay0Alpha = 6c7086 | ||
60 | |||
61 | $surface2 = rgb(585b70) | ||
62 | $surface2Alpha = 585b70 | ||
63 | |||
64 | $surface1 = rgb(45475a) | ||
65 | $surface1Alpha = 45475a | ||
66 | |||
67 | $surface0 = rgb(313244) | ||
68 | $surface0Alpha = 313244 | ||
69 | |||
70 | $base = rgb(1e1e2e) | ||
71 | $baseAlpha = 1e1e2e | ||
72 | |||
73 | $mantle = rgb(181825) | ||
74 | $mantleAlpha = 181825 | ||
75 | |||
76 | $crust = rgb(11111b) | ||
77 | $crustAlpha = 11111b | ||
diff --git a/.config/hypr/scripts/switch.sh b/.config/hypr/scripts/switch.sh new file mode 100755 index 0000000..81ae9e8 --- /dev/null +++ b/.config/hypr/scripts/switch.sh | |||
@@ -0,0 +1,10 @@ | |||
1 | #!/usr/bin/env bash | ||
2 | # https://github.com/hyprwm/Hyprland/issues/1754#issue-1618824532 | ||
3 | |||
4 | if grep open /proc/acpi/button/lid/LID0/state; then | ||
5 | hyprctl keyword monitor "eDP-1,highres,auto,1" | ||
6 | else | ||
7 | if [[ `hyprctl monitors | grep "Monitor" | wc -l` != 1 ]]; then | ||
8 | hyprctl keyword monitor "eDP-1, disable" | ||
9 | fi | ||
10 | fi | ||
diff --git a/.config/hypr/shaders/chromatic_abberation.frag b/.config/hypr/shaders/chromatic_abberation.frag new file mode 100644 index 0000000..5389241 --- /dev/null +++ b/.config/hypr/shaders/chromatic_abberation.frag | |||
@@ -0,0 +1,24 @@ | |||
1 | // vim: set ft=glsl: | ||
2 | |||
3 | precision highp float; | ||
4 | varying highp vec2 v_texcoord; | ||
5 | uniform highp sampler2D tex; | ||
6 | |||
7 | #define STRENGTH 0.0027 | ||
8 | |||
9 | void main() { | ||
10 | vec2 center = vec2(0.5, 0.5); | ||
11 | vec2 offset = (v_texcoord - center) * STRENGTH; | ||
12 | |||
13 | float rSquared = dot(offset, offset); | ||
14 | float distortion = 1.0 + 1.0 * rSquared; | ||
15 | vec2 distortedOffset = offset * distortion; | ||
16 | |||
17 | vec2 redOffset = vec2(distortedOffset.x, distortedOffset.y); | ||
18 | vec2 blueOffset = vec2(distortedOffset.x, distortedOffset.y); | ||
19 | |||
20 | vec4 redColor = texture2D(tex, v_texcoord + redOffset); | ||
21 | vec4 blueColor = texture2D(tex, v_texcoord + blueOffset); | ||
22 | |||
23 | gl_FragColor = vec4(redColor.r, texture2D(tex, v_texcoord).g, blueColor.b, 1.0); | ||
24 | } | ||
diff --git a/.config/hypr/shaders/crt.frag b/.config/hypr/shaders/crt.frag new file mode 100644 index 0000000..a37ff9f --- /dev/null +++ b/.config/hypr/shaders/crt.frag | |||
@@ -0,0 +1,511 @@ | |||
1 | #version 100 | ||
2 | precision highp float; | ||
3 | varying highp vec2 v_texcoord; | ||
4 | varying highp vec3 v_pos; | ||
5 | uniform highp sampler2D tex; | ||
6 | uniform lowp float time; | ||
7 | |||
8 | #define BORDER_COLOR vec4(vec3(0.0, 0.0, 0.0), 1.0) // black border | ||
9 | #define BORDER_RADIUS 1.0 // larger vignette radius | ||
10 | #define BORDER_SIZE 0.01 // small border size | ||
11 | #define CHROMATIC_ABERRATION_STRENGTH 0.00 | ||
12 | #define DENOISE_INTENSITY 0.0001 // | ||
13 | #define DISTORTION_AMOUNT 0.00 // moderate distortion amount | ||
14 | #define HDR_BLOOM 0.75 // bloom intensity | ||
15 | #define HDR_BRIGHTNESS 0.011 // brightness | ||
16 | #define HDR_CONTRAST 0.011 // contrast | ||
17 | #define HDR_SATURATION 1.0// saturation | ||
18 | #define LENS_DISTORTION_AMOUNT 0.0 | ||
19 | #define NOISE_THRESHOLD 0.0001 | ||
20 | #define PHOSPHOR_BLUR_AMOUNT 0.77 // Amount of blur for phosphor glow | ||
21 | #define PHOSPHOR_GLOW_AMOUNT 0.77 // Amount of phosphor glow | ||
22 | #define SAMPLING_RADIUS 0.0001 | ||
23 | #define SCANLINE_FREQUENCY 540.0 | ||
24 | #define SCANLINE_THICKNESS 0.0507 | ||
25 | #define SCANLINE_TIME time * 471.24 | ||
26 | #define SHARPNESS 0.25 | ||
27 | #define SUPERSAMPLING_SAMPLES 16.0 | ||
28 | #define VIGNETTE_RADIUS 0.0 // larger vignette radius | ||
29 | #define PI 3.14159265359 | ||
30 | #define TWOPI 6.28318530718 | ||
31 | |||
32 | vec2 applyBarrelDistortion(vec2 coord, float amt) { | ||
33 | vec2 p = coord.xy / vec2(1.0); | ||
34 | vec2 v = p * 2.0 - vec2(1.0); | ||
35 | float r = dot(v, v); | ||
36 | float k = 1.0 + pow(r, 2.0) * pow(amt, 2.0); | ||
37 | vec2 result = v * k; | ||
38 | return vec2(0.5, 0.5) + 0.5 * result.xy; | ||
39 | } | ||
40 | |||
41 | vec4 applyColorCorrection(vec4 color) { | ||
42 | color.rgb *= vec3(1.0, 0.79, 0.89); | ||
43 | return vec4(color.rgb, 1.0); | ||
44 | } | ||
45 | |||
46 | vec4 applyBorder(vec2 tc, vec4 color, float borderSize, vec4 borderColor) { | ||
47 | float dist_x = min(tc.x, 1.0 - tc.x); | ||
48 | float dist_y = min(tc.y, 1.0 - tc.y); | ||
49 | float dist = min(dist_x, dist_y) * -1.0; | ||
50 | float border = smoothstep(borderSize, 0.0, dist); | ||
51 | border += smoothstep(borderSize, 0.0, dist); | ||
52 | return mix(color, borderColor, border); | ||
53 | } | ||
54 | |||
55 | vec4 applyFakeHDR(vec4 color, float brightness, float contrast, float saturation, float bloom) { | ||
56 | color.rgb = (color.rgb - vec3(0.5)) * exp2(brightness) + vec3(0.5); | ||
57 | vec3 crtfactor = vec3(1.05, 0.92, 1.0); | ||
58 | color.rgb = pow(color.rgb, crtfactor); | ||
59 | // // NTSC | ||
60 | // vec3 lumCoeff = vec3(0.2125, 0.7154, 0.0721); | ||
61 | |||
62 | // // BT.709 | ||
63 | // vec3 lumCoeff = vec3(0.299, 0.587, 0.114); | ||
64 | |||
65 | // BT.2020 | ||
66 | vec3 lumCoeff = vec3(0.2627, 0.6780, 0.0593); | ||
67 | |||
68 | // // Warm NTSC | ||
69 | // vec3 lumCoeff = vec3(0.2125, 0.7010, 0.0865); | ||
70 | |||
71 | float luminance = dot(color.rgb, lumCoeff); | ||
72 | luminance = pow(luminance, 2.2); | ||
73 | color.rgb = mix(vec3(luminance), color.rgb, saturation); | ||
74 | color.rgb = mix(color.rgb, vec3(1.0), pow(max(0.0, luminance - 1.0 + bloom), 4.0)); | ||
75 | return color; | ||
76 | } | ||
77 | |||
78 | vec4 applyVignette(vec4 color) { | ||
79 | vec2 center = vec2(0.5, 0.5); // center of screen | ||
80 | float radius = VIGNETTE_RADIUS; // radius of vignette effect | ||
81 | float softness = 1.0; // softness of vignette effect | ||
82 | float intensity = 0.7; // intensity of vignette effect | ||
83 | vec2 offset = v_texcoord - center; // offset from center of screen | ||
84 | float distance = length(offset); // distance from center of screen | ||
85 | float alpha = smoothstep(radius, radius - radius * softness, distance) * intensity; // calculate alpha value for vignette effect | ||
86 | return mix(vec4(0.0, 0.0, 0.0, alpha), color, alpha); // mix black with color using calculated alpha value | ||
87 | } | ||
88 | |||
89 | vec4 applyPhosphorGlow(vec2 tc, vec4 color, sampler2D tex) { | ||
90 | // Calculate average color value of the texture | ||
91 | vec4 texelColor = color; | ||
92 | float averageColor = (texelColor.r + texelColor.g + texelColor.b) / 3.0; | ||
93 | |||
94 | // Determine brightness-dependent color factor | ||
95 | float factor = mix( | ||
96 | mix(0.09, | ||
97 | mix(0.005, 0.0075, (averageColor - 0.1) / 0.1), | ||
98 | step(0.01, averageColor)), 0.0005, | ||
99 | step(0.02, averageColor)); | ||
100 | // Apply phosphor glow effect | ||
101 | vec4 sum = vec4(0.0); | ||
102 | vec4 pixels[9]; | ||
103 | pixels[0] = texture2D(tex, tc - vec2(0.001, 0.001)); | ||
104 | pixels[1] = texture2D(tex, tc - vec2(0.001, 0.0)); | ||
105 | pixels[2] = texture2D(tex, tc - vec2(0.001, -0.001)); | ||
106 | pixels[3] = texture2D(tex, tc - vec2(0.0, 0.001)); | ||
107 | pixels[4] = texture2D(tex, tc); | ||
108 | pixels[5] = texture2D(tex, tc + vec2(0.001, 0.001)); | ||
109 | pixels[6] = texture2D(tex, tc + vec2(0.001, 0.0)); | ||
110 | pixels[7] = texture2D(tex, tc + vec2(0.001, -0.001)); | ||
111 | pixels[8] = texture2D(tex, tc + vec2(0.0, 0.001)); | ||
112 | |||
113 | // Perform operations on input pixels in parallel | ||
114 | sum = pixels[0] | ||
115 | + pixels[1] | ||
116 | + pixels[2] | ||
117 | + pixels[3] | ||
118 | + pixels[4] | ||
119 | + pixels[5] | ||
120 | + pixels[6] | ||
121 | + pixels[7] | ||
122 | + pixels[8]; | ||
123 | sum /= 9.0; | ||
124 | sum += texture2D(tex, tc - vec2(0.01, 0.01)) * 0.001; | ||
125 | sum += texture2D(tex, tc - vec2(0.0, 0.01)) * 0.001; | ||
126 | sum += texture2D(tex, tc - vec2(-0.01, 0.01)) * 0.001; | ||
127 | sum += texture2D(tex, tc - vec2(0.01, 0.0)) * 0.001; | ||
128 | sum += color * PHOSPHOR_BLUR_AMOUNT; | ||
129 | sum += texture2D(tex, tc - vec2(-0.01, 0.0)) * 0.001; | ||
130 | sum += texture2D(tex, tc - vec2(0.01, -0.01)) * 0.001; | ||
131 | sum += texture2D(tex, tc - vec2(0.0, -0.01)) * 0.001; | ||
132 | sum += texture2D(tex, tc - vec2(-0.01, -0.01)) * 0.001; | ||
133 | sum *= PHOSPHOR_GLOW_AMOUNT; | ||
134 | |||
135 | // Initialize sum_sum_factor to zero | ||
136 | vec4 sum_sum_factor = vec4(0.0); | ||
137 | // Compute sum_j for i = -1 | ||
138 | vec4 sum_j = vec4(0.0); | ||
139 | sum_j += texture2D(tex, tc + vec2(-1, -1) * 0.01); | ||
140 | sum_j += texture2D(tex, tc + vec2(0, -1) * 0.01); | ||
141 | sum_j += texture2D(tex, tc + vec2(1, -1) * 0.01); | ||
142 | sum_j += texture2D(tex, tc + vec2(-1, 0) * 0.01); | ||
143 | sum_j += texture2D(tex, tc + vec2(0, 0) * 0.01); | ||
144 | sum_j += texture2D(tex, tc + vec2(1, 0) * 0.01); | ||
145 | sum_j += texture2D(tex, tc + vec2(-1, 1) * 0.01); | ||
146 | sum_j += texture2D(tex, tc + vec2(0, 1) * 0.01); | ||
147 | sum_j += texture2D(tex, tc + vec2(1, 1) * 0.01); | ||
148 | sum_sum_factor += sum_j * vec4(0.011); | ||
149 | |||
150 | // Compute sum_j for i = 0 | ||
151 | sum_j = vec4(0.0); | ||
152 | sum_j += texture2D(tex, tc + vec2(-1, 0) * 0.01); | ||
153 | sum_j += texture2D(tex, tc + vec2(0, 0) * 0.01); | ||
154 | sum_j += texture2D(tex, tc + vec2(1, 0) * 0.01); | ||
155 | sum_j += texture2D(tex, tc + vec2(-1, 1) * 0.01); | ||
156 | sum_j += texture2D(tex, tc + vec2(0, 1) * 0.01); | ||
157 | sum_j += texture2D(tex, tc + vec2(1, 1) * 0.01); | ||
158 | sum_sum_factor += sum_j * vec4(0.011); | ||
159 | |||
160 | // Compute sum_j for i = 1 | ||
161 | sum_j = vec4(0.0); | ||
162 | sum_j += texture2D(tex, tc + vec2(-1, 0) * 0.01); | ||
163 | sum_j += texture2D(tex, tc + vec2(0, 1) * 0.01); | ||
164 | sum_j += texture2D(tex, tc + vec2(1, 0) * 0.01); | ||
165 | sum_j += texture2D(tex, tc + vec2(-1, 1) * 0.01); | ||
166 | sum_j += texture2D(tex, tc + vec2(0, 1) * 0.01); | ||
167 | sum_j += texture2D(tex, tc + vec2(1, 1) * 0.01); | ||
168 | sum_sum_factor += sum_j * vec4(0.011); | ||
169 | color += mix(sum_sum_factor * sum_sum_factor * vec4(factor), sum, 0.5); | ||
170 | return color; | ||
171 | } | ||
172 | |||
173 | vec4 applyAdaptiveSharpen(vec2 tc, vec4 color, sampler2D tex) { | ||
174 | vec4 color_tl = texture2D(tex, tc + vec2(-1.0, -1.0) * 0.5 / 2160.0); | ||
175 | vec4 color_tr = texture2D(tex, tc + vec2(1.0, -1.0) * 0.5 / 2160.0); | ||
176 | vec4 color_bl = texture2D(tex, tc + vec2(-1.0, 1.0) * 0.5 / 2160.0); | ||
177 | vec4 color_br = texture2D(tex, tc + vec2(1.0, 1.0) * 0.5 / 2160.0); | ||
178 | float sharpness = SHARPNESS; | ||
179 | vec3 color_no_alpha = color.rgb; | ||
180 | vec3 color_tl_no_alpha = color_tl.rgb; | ||
181 | vec3 color_tr_no_alpha = color_tr.rgb; | ||
182 | vec3 color_bl_no_alpha = color_bl.rgb; | ||
183 | vec3 color_br_no_alpha = color_br.rgb; | ||
184 | float delta = (dot(color_no_alpha, vec3(0.333333)) + dot(color_tl_no_alpha, vec3(0.333333)) + dot(color_tr_no_alpha, vec3(0.333333)) + dot(color_bl_no_alpha, vec3(0.333333)) + dot(color_br_no_alpha, vec3(0.333333))) * 0.2 - dot(color_no_alpha, vec3(0.333333)); | ||
185 | vec3 sharp_color_no_alpha = color_no_alpha + min(vec3(0.0), vec3(delta * sharpness)); | ||
186 | vec4 sharp_color = vec4(sharp_color_no_alpha, color.a); | ||
187 | return sharp_color; | ||
188 | } | ||
189 | |||
190 | vec4 applyScanlines(vec2 tc, vec4 color) { | ||
191 | float scanline = (cos(tc.y * SCANLINE_FREQUENCY + SCANLINE_TIME) * | ||
192 | sin(tc.y * SCANLINE_FREQUENCY + SCANLINE_TIME)) * SCANLINE_THICKNESS; | ||
193 | float alpha = clamp(1.0 - abs(scanline), 0.0, 1.0); | ||
194 | return vec4(color.rgb * alpha, color.a); | ||
195 | } | ||
196 | |||
197 | vec4 applyChromaticAberration(vec2 uv, vec4 color) { | ||
198 | vec2 center = vec2(0.5, 0.5); // center of the screen | ||
199 | vec2 offset = (uv - center) * CHROMATIC_ABERRATION_STRENGTH; // calculate the offset from the center | ||
200 | |||
201 | // apply lens distortion | ||
202 | float rSquared = dot(offset, offset); | ||
203 | float distortion = 1.0 + LENS_DISTORTION_AMOUNT * rSquared; | ||
204 | vec2 distortedOffset = offset * distortion; | ||
205 | |||
206 | // apply chromatic aberration | ||
207 | vec2 redOffset = vec2(distortedOffset.x * 1.00, distortedOffset.y * 1.00); | ||
208 | vec2 blueOffset = vec2(distortedOffset.x * 1.00, distortedOffset.y * 1.00); | ||
209 | |||
210 | vec4 redColor = texture2D(tex, uv + redOffset); | ||
211 | vec4 blueColor = texture2D(tex, uv + blueOffset); | ||
212 | |||
213 | vec4 result = vec4(redColor.r, color.g, blueColor.b, color.a); | ||
214 | |||
215 | return result; | ||
216 | } | ||
217 | |||
218 | vec4 reduceGlare(vec4 color) { | ||
219 | // Calculate the intensity of the color by taking the average of the RGB components | ||
220 | float intensity = (color.r + color.g + color.b) / 3.0; | ||
221 | // Set the maximum intensity that can be considered for glare | ||
222 | float maxIntensity = 0.98; | ||
223 | // Use smoothstep to create a smooth transition from no glare to full glare | ||
224 | // based on the intensity of the color and the maximum intensity | ||
225 | float glareIntensity = smoothstep(maxIntensity - 0.02, maxIntensity, intensity); | ||
226 | // Set the amount of glare to apply to the color | ||
227 | float glareAmount = 0.02; | ||
228 | // Mix the original color with the reduced color that has glare applied to it | ||
229 | vec3 reducedColor = mix(color.rgb, vec3(glareIntensity), glareAmount); | ||
230 | // Return the reduced color with the original alpha value | ||
231 | return vec4(reducedColor, color.a); | ||
232 | } | ||
233 | |||
234 | // Apply a fake HDR effect to the input color. | ||
235 | // Parameters: | ||
236 | // - inputColor: the color to apply the effect to. | ||
237 | // - brightness: the brightness of the image. Should be a value between 0 and 1. | ||
238 | // - contrast: the contrast of the image. Should be a value between 0 and 1. | ||
239 | // - saturation: the saturation of the image. Should be a value between 0 and 2. | ||
240 | // - bloom: the intensity of the bloom effect. Should be a value between 0 and 1. | ||
241 | vec4 applyFakeHDREffect(vec4 inputColor, float brightness, float contrast, float saturation, float bloom) { | ||
242 | const float minBrightness = 0.0; | ||
243 | const float maxBrightness = 1.0; | ||
244 | const float minContrast = 0.0; | ||
245 | const float maxContrast = 1.0; | ||
246 | const float minSaturation = 0.0; | ||
247 | const float maxSaturation = 2.0; | ||
248 | const float minBloom = 0.0; | ||
249 | const float maxBloom = 1.0; | ||
250 | |||
251 | // Check input parameters for validity | ||
252 | if (brightness < minBrightness || brightness > maxBrightness) { | ||
253 | return vec4(0.0, 0.0, 0.0, 1.0); // Return black with alpha of 1.0 to indicate error | ||
254 | } | ||
255 | if (contrast < minContrast || contrast > maxContrast) { | ||
256 | return vec4(0.0, 0.0, 0.0, 1.0); | ||
257 | } | ||
258 | if (saturation < minSaturation || saturation > maxSaturation) { | ||
259 | return vec4(0.0, 0.0, 0.0, 1.0); | ||
260 | } | ||
261 | if (bloom < minBloom || bloom > maxBloom) { | ||
262 | return vec4(0.0, 0.0, 0.0, 1.0); | ||
263 | } | ||
264 | |||
265 | // Apply brightness and contrast | ||
266 | vec3 color = inputColor.rgb; | ||
267 | color = (color - vec3(0.5)) * exp2(brightness * 10.0) + vec3(0.5); | ||
268 | color = mix(vec3(0.5), color, pow(contrast * 4.0 + 1.0, 2.0)); | ||
269 | |||
270 | // // NTSC | ||
271 | // vec3 lumCoeff = vec3(0.2125, 0.7154, 0.0721); | ||
272 | |||
273 | // // BT.709 | ||
274 | // vec3 lumCoeff = vec3(0.299, 0.587, 0.114); | ||
275 | |||
276 | // // BT.2020 | ||
277 | // vec3 lumCoeff = vec3(0.2627, 0.6780, 0.0593); | ||
278 | |||
279 | // Warm NTSC | ||
280 | vec3 lumCoeff = vec3(0.2125, 0.7010, 0.0865); | ||
281 | |||
282 | // Apply saturation | ||
283 | float luminance = dot(color, lumCoeff); | ||
284 | vec3 grey = vec3(luminance); | ||
285 | color = mix(grey, color, saturation); | ||
286 | |||
287 | // Apply bloom effect | ||
288 | float threshold = 1.0 - bloom; | ||
289 | vec3 bloomColor = max(color - threshold, vec3(0.0)); | ||
290 | bloomColor = pow(bloomColor, vec3(2.0)); | ||
291 | bloomColor = mix(vec3(0.0), bloomColor, pow(min(luminance, threshold), 4.0)); | ||
292 | color += bloomColor; | ||
293 | |||
294 | return vec4(color, inputColor.a); | ||
295 | } | ||
296 | |||
297 | vec4 bilateralFilter(sampler2D tex, vec2 uv, vec4 color, float sampleRadius, float noiseThreshold, float intensity) { | ||
298 | vec4 filteredColor = vec4(0.0); | ||
299 | float totalWeight = 0.0; | ||
300 | |||
301 | // Top-left pixel | ||
302 | vec4 sample = texture2D(tex, uv + vec2(-1.0, -1.0)); | ||
303 | float dist = length(vec2(-1.0, -1.0)); | ||
304 | float colorDist = length(sample - color); | ||
305 | float weight = exp(-0.5 * (dist * dist + colorDist * colorDist * intensity) / (sampleRadius * sampleRadius)); | ||
306 | filteredColor += sample * weight; | ||
307 | totalWeight += weight; | ||
308 | |||
309 | // Top pixel | ||
310 | sample = texture2D(tex, uv + vec2(0.0, -1.0)); | ||
311 | dist = length(vec2(0.0, -1.0)); | ||
312 | colorDist = length(sample - color); | ||
313 | weight = exp(-0.5 * (dist * dist + colorDist * colorDist * intensity) / (sampleRadius * sampleRadius)); | ||
314 | filteredColor += sample * weight; | ||
315 | totalWeight += weight; | ||
316 | |||
317 | // Top-right pixel | ||
318 | sample = texture2D(tex, uv + vec2(1.0, -1.0)); | ||
319 | dist = length(vec2(1.0, -1.0)); | ||
320 | colorDist = length(sample - color); | ||
321 | weight = exp(-0.5 * (dist * dist + colorDist * colorDist * intensity) / (sampleRadius * sampleRadius)); | ||
322 | filteredColor += sample * weight; | ||
323 | totalWeight += weight; | ||
324 | |||
325 | // Left pixel | ||
326 | sample = texture2D(tex, uv + vec2(-1.0, 0.0)); | ||
327 | dist = length(vec2(-1.0, 0.0)); | ||
328 | colorDist = length(sample - color); | ||
329 | weight = exp(-0.5 * (dist * dist + colorDist * colorDist * intensity) / (sampleRadius * sampleRadius)); | ||
330 | filteredColor += sample * weight; | ||
331 | totalWeight += weight; | ||
332 | |||
333 | // Center pixel | ||
334 | sample = texture2D(tex, uv); | ||
335 | dist = 0.0; | ||
336 | colorDist = length(sample - color); | ||
337 | weight = exp(-0.5 * (dist * dist + colorDist * colorDist * intensity) / (sampleRadius * sampleRadius)); | ||
338 | filteredColor += sample * weight; | ||
339 | totalWeight += weight; | ||
340 | |||
341 | // Right pixel | ||
342 | sample = texture2D(tex, uv + vec2(1.0, 0.0)); | ||
343 | dist = length(vec2(1.0, 0.0)); | ||
344 | colorDist = length(sample - color); | ||
345 | weight = exp(-0.5 * (dist * dist + colorDist * colorDist * intensity) / (sampleRadius * sampleRadius)); | ||
346 | filteredColor += sample * weight; | ||
347 | totalWeight += weight; | ||
348 | |||
349 | // Bottom-left pixel | ||
350 | sample = texture2D(tex, uv + vec2(-1.0, 1.0)); | ||
351 | dist = length(vec2(-1.0, 1.0)); | ||
352 | colorDist = length(sample - color); | ||
353 | weight = exp(-0.5 * (dist * dist + colorDist * colorDist * intensity) / (sampleRadius * sampleRadius)); | ||
354 | filteredColor += sample * weight; | ||
355 | totalWeight += weight; | ||
356 | |||
357 | // Bottom pixel | ||
358 | sample = texture2D(tex, uv + vec2(0.0, sampleRadius)); | ||
359 | dist = length(vec2(0.0, sampleRadius)); | ||
360 | colorDist = length(sample - color); | ||
361 | weight = exp(-0.5 * (dist * dist + colorDist * colorDist * intensity) / (sampleRadius * sampleRadius)); | ||
362 | filteredColor += sample * weight; | ||
363 | totalWeight += weight; | ||
364 | |||
365 | filteredColor /= totalWeight; | ||
366 | return mix(color, filteredColor, step(noiseThreshold, length(filteredColor - color))); | ||
367 | } | ||
368 | |||
369 | vec4 supersample(sampler2D tex, vec2 uv, float sampleRadius, float noiseThreshold, float intensity) { | ||
370 | float radiusSq = sampleRadius * sampleRadius; | ||
371 | vec2 poissonDisk; | ||
372 | vec4 color = vec4(0.0); | ||
373 | |||
374 | float r1_0 = sqrt(0.0 / 16.0); | ||
375 | float r2_0 = fract(1.0 / 3.0); | ||
376 | float theta_0 = TWOPI * r2_0; | ||
377 | poissonDisk = vec2(r1_0 * cos(theta_0), r1_0 * sin(theta_0)); | ||
378 | color += texture2D(tex, uv + poissonDisk * sampleRadius); | ||
379 | |||
380 | float r1_1 = sqrt(1.0 / 16.0); | ||
381 | float r2_1 = fract(2.0 / 3.0); | ||
382 | float theta_1 = TWOPI * r2_1; | ||
383 | poissonDisk = vec2(r1_1 * cos(theta_1), r1_1 * sin(theta_1)); | ||
384 | color += texture2D(tex, uv + poissonDisk * sampleRadius); | ||
385 | |||
386 | float r1_2 = sqrt(2.0 / 16.0); | ||
387 | float r2_2 = fract(3.0 / 3.0); | ||
388 | float theta_2 = TWOPI * r2_2; | ||
389 | poissonDisk = vec2(r1_2 * cos(theta_2), r1_2 * sin(theta_2)); | ||
390 | color += texture2D(tex, uv + poissonDisk * sampleRadius); | ||
391 | |||
392 | float r1_3 = sqrt(3.0 / 16.0); | ||
393 | float r2_3 = fract(4.0 / 3.0); | ||
394 | float theta_3 = TWOPI * r2_3; | ||
395 | poissonDisk = vec2(r1_3 * cos(theta_3), r1_3 * sin(theta_3)); | ||
396 | color += texture2D(tex, uv + poissonDisk * sampleRadius); | ||
397 | |||
398 | float r1_4 = sqrt(4.0 / 16.0); | ||
399 | float r2_4 = fract(5.0 / 3.0); | ||
400 | float theta_4 = TWOPI * r2_4; | ||
401 | poissonDisk = vec2(r1_4 * cos(theta_4), r1_4 * sin(theta_4)); | ||
402 | color += texture2D(tex, uv + poissonDisk * sampleRadius); | ||
403 | |||
404 | float r1_5 = sqrt(5.0 / 16.0); | ||
405 | float r2_5 = fract(6.0 / 3.0); | ||
406 | float theta_5 = TWOPI * r2_5; | ||
407 | poissonDisk = vec2(r1_5 * cos(theta_5), r1_5 * sin(theta_5)); | ||
408 | color += texture2D(tex, uv + poissonDisk * sampleRadius); | ||
409 | |||
410 | float r1_6 = sqrt(6.0 / 16.0); | ||
411 | float r2_6 = fract(7.0 / 3.0); | ||
412 | float theta_6 = TWOPI * r2_6; | ||
413 | poissonDisk = vec2(r1_6 * cos(theta_6), r1_6 * sin(theta_6)); | ||
414 | color += texture2D(tex, uv + poissonDisk * sampleRadius); | ||
415 | |||
416 | float r1_7 = sqrt(7.0 / 16.0); | ||
417 | float r2_7 = fract(8.0 / 3.0); | ||
418 | float theta_7 = TWOPI * r2_7; | ||
419 | poissonDisk = vec2(r1_7 * cos(theta_7), r1_7 * sin(theta_7)); | ||
420 | color += texture2D(tex, uv + poissonDisk * sampleRadius); | ||
421 | |||
422 | float r1_8 = sqrt(8.0 / 16.0); | ||
423 | float r2_8 = fract(9.0 / 3.0); | ||
424 | float theta_8 = TWOPI * r2_8; | ||
425 | poissonDisk = vec2(r1_8 * cos(theta_8), r1_8 * sin(theta_8)); | ||
426 | color += texture2D(tex, uv + poissonDisk * sampleRadius); | ||
427 | |||
428 | float r1_9 = sqrt(9.0 / 16.0); | ||
429 | float r2_9 = fract(10.0 / 3.0); | ||
430 | float theta_9 = TWOPI * r2_9; | ||
431 | poissonDisk = vec2(r1_9 * cos(theta_9), r1_9 * sin(theta_9)); | ||
432 | color += texture2D(tex, uv + poissonDisk * sampleRadius); | ||
433 | |||
434 | float r1_10 = sqrt(10.0 / 16.0); | ||
435 | float r2_10 = fract(11.0 / 3.0); | ||
436 | float theta_10 = TWOPI * r2_10; | ||
437 | poissonDisk = vec2(r1_10 * cos(theta_10), r1_10 * sin(theta_10)); | ||
438 | color += texture2D(tex, uv + poissonDisk * sampleRadius); | ||
439 | |||
440 | float r1_11 = sqrt(11.0 / 16.0); | ||
441 | float r2_11 = fract(12.0 / 3.0); | ||
442 | float theta_11 = TWOPI * r2_11; | ||
443 | poissonDisk = vec2(r1_11 * cos(theta_11), r1_11 * sin(theta_11)); | ||
444 | color += texture2D(tex, uv + poissonDisk * sampleRadius); | ||
445 | |||
446 | float r1_12 = sqrt(12.0 / 16.0); | ||
447 | float r2_12 = fract(13.0 / 3.0); | ||
448 | float theta_12 = TWOPI * r2_12; | ||
449 | poissonDisk = vec2(r1_12 * cos(theta_12), r1_12 * sin(theta_12)); | ||
450 | color += texture2D(tex, uv + poissonDisk * sampleRadius); | ||
451 | |||
452 | float r1_13 = sqrt(13.0 / 16.0); | ||
453 | float r2_13 = fract(14.0 / 3.0); | ||
454 | float theta_13 = TWOPI * r2_13; | ||
455 | poissonDisk = vec2(r1_13 * cos(theta_13), r1_13 * sin(theta_13)); | ||
456 | color += texture2D(tex, uv + poissonDisk * sampleRadius); | ||
457 | |||
458 | float r1_14 = sqrt(14.0 / 16.0); | ||
459 | float r2_14 = fract(15.0 / 3.0); | ||
460 | float theta_14 = TWOPI * r2_14; | ||
461 | poissonDisk = vec2(r1_14 * cos(theta_14), r1_14 * sin(theta_14)); | ||
462 | color += texture2D(tex, uv + poissonDisk * sampleRadius); | ||
463 | |||
464 | float r1_15 = sqrt(15.0 / 16.0); | ||
465 | float r2_15 = fract(16.0 / 3.0); | ||
466 | float theta_15 = TWOPI * r2_15; | ||
467 | poissonDisk = vec2(r1_15 * cos(theta_15), r1_15 * sin(theta_15)); | ||
468 | color += texture2D(tex, uv + poissonDisk * sampleRadius); | ||
469 | |||
470 | return bilateralFilter(tex, uv, color, sampleRadius, noiseThreshold, intensity); | ||
471 | } | ||
472 | void main() { | ||
473 | vec2 tc_no_dist = v_texcoord; | ||
474 | |||
475 | vec2 tc = applyBarrelDistortion(tc_no_dist, DISTORTION_AMOUNT); | ||
476 | |||
477 | // [-1, 1] | ||
478 | vec2 tc_no_dist_symmetric = tc_no_dist * 2.0 - 1.0; | ||
479 | |||
480 | // [0,1] | ||
481 | vec2 tc_no_dist_normalized = (tc_no_dist_symmetric + 1.0) / 2.0; | ||
482 | |||
483 | // vec4 color = texture2D(tex, tc); | ||
484 | vec4 color = supersample(tex, tc, SAMPLING_RADIUS, NOISE_THRESHOLD, DENOISE_INTENSITY); | ||
485 | |||
486 | color = applyAdaptiveSharpen(tc, color, tex); | ||
487 | |||
488 | color = applyPhosphorGlow(tc, color, tex); | ||
489 | |||
490 | color = reduceGlare(color); | ||
491 | |||
492 | color = mix(applyFakeHDREffect(color, HDR_BRIGHTNESS, HDR_CONTRAST, HDR_SATURATION, HDR_BLOOM), color, 0.5); | ||
493 | |||
494 | color = applyColorCorrection(color); | ||
495 | |||
496 | color /= SUPERSAMPLING_SAMPLES; | ||
497 | |||
498 | color = mix(applyChromaticAberration(tc, color), color, 0.25); | ||
499 | |||
500 | color = mix(color, applyVignette(color), 0.37); | ||
501 | |||
502 | color = applyBorder(tc_no_dist_normalized, color, 1.0 - BORDER_SIZE * BORDER_RADIUS, BORDER_COLOR); | ||
503 | |||
504 | color = mix(applyBorder(tc, color, BORDER_SIZE, BORDER_COLOR), color, 0.05); | ||
505 | |||
506 | color = applyScanlines(tc, color); | ||
507 | |||
508 | gl_FragColor = color; | ||
509 | gl_FragColor.a = 1.0; | ||
510 | } | ||
511 | |||
diff --git a/.config/hypr/shaders/drugs.frag b/.config/hypr/shaders/drugs.frag new file mode 100644 index 0000000..1190ed0 --- /dev/null +++ b/.config/hypr/shaders/drugs.frag | |||
@@ -0,0 +1,42 @@ | |||
1 | |||
2 | precision highp float; | ||
3 | varying vec2 v_texcoord; | ||
4 | uniform sampler2D tex; | ||
5 | uniform float time; | ||
6 | |||
7 | void warpco(inout vec2 tc) { | ||
8 | tc -= 0.5; | ||
9 | tc *= length(tc) * 2.0; | ||
10 | tc += 0.5; | ||
11 | } | ||
12 | |||
13 | float rand1d(float seed) { | ||
14 | return sin(seed*1454.0); | ||
15 | } | ||
16 | |||
17 | float rand2d(vec2 co) | ||
18 | { | ||
19 | return fract(sin(dot(co.xy, vec2(12.9898,78.233))) * 43758.5453); | ||
20 | } | ||
21 | |||
22 | vec3 rgb(in vec2 tc, float freq, float amp, inout vec4 centre) { | ||
23 | vec2 off = vec2(1.0/800.0, 0.0) * sin(tc.t * freq + time) * amp; | ||
24 | vec2 off2 = vec2(1.0/800.0, 0.0) * sin(tc.t * freq - time * 1.5) * amp; | ||
25 | centre = texture2D(tex, tc); | ||
26 | return vec3(texture2D(tex, tc-off).r, centre.g, texture2D(tex, tc+off2).b); | ||
27 | } | ||
28 | |||
29 | void main() { | ||
30 | // vec2 px = 1.0 / textureSize(tex, 0).st; | ||
31 | vec2 tc = v_texcoord; | ||
32 | warpco(tc); | ||
33 | tc = mix(v_texcoord, tc, sin(time * 2.0)*0.07); | ||
34 | tc.x += rand2d(floor(tc * 20.0 + floor(time * 2.5))) * 0.01; | ||
35 | tc.x += rand1d(floor(tc.x * 40.0)) * 0.005 * rand1d(time * 0.001); | ||
36 | tc.y += sin(tc.x + time) * 0.02; | ||
37 | vec4 centre; | ||
38 | vec3 bent = rgb(tc, 100.0, 5.0, centre); | ||
39 | vec3 col = mix(centre.rgb, bent, sin(time)); | ||
40 | gl_FragColor = vec4(col, centre.a); | ||
41 | // gl_FragColor = vec4(texture2D(tex, v_texcoord)); | ||
42 | } \ No newline at end of file | ||
diff --git a/.config/hypr/shaders/extradark.frag b/.config/hypr/shaders/extradark.frag new file mode 100644 index 0000000..089ee81 --- /dev/null +++ b/.config/hypr/shaders/extradark.frag | |||
@@ -0,0 +1,21 @@ | |||
1 | // vim: set ft=glsl: | ||
2 | // blue light filter shader | ||
3 | // values from https://reshade.me/forum/shader-discussion/3673-blue-light-filter-similar-to-f-lux | ||
4 | |||
5 | precision mediump float; | ||
6 | varying vec2 v_texcoord; | ||
7 | uniform sampler2D tex; | ||
8 | |||
9 | void main() { | ||
10 | |||
11 | vec4 pixColor = texture2D(tex, v_texcoord); | ||
12 | |||
13 | // red | ||
14 | pixColor[0] *= 0.7; | ||
15 | // green | ||
16 | pixColor[1] *= 0.6; | ||
17 | // blue | ||
18 | pixColor[2] *= 0.5; | ||
19 | |||
20 | gl_FragColor = pixColor; | ||
21 | } | ||
diff --git a/.config/hypr/shaders/invert.frag b/.config/hypr/shaders/invert.frag new file mode 100644 index 0000000..864f718 --- /dev/null +++ b/.config/hypr/shaders/invert.frag | |||
@@ -0,0 +1,13 @@ | |||
1 | // vim: set ft=glsl: | ||
2 | // blue light filter shader | ||
3 | // values from https://reshade.me/forum/shader-discussion/3673-blue-light-filter-similar-to-f-lux | ||
4 | |||
5 | precision mediump float; | ||
6 | varying vec2 v_texcoord; | ||
7 | uniform sampler2D tex; | ||
8 | |||
9 | void main() { | ||
10 | vec4 pixColor = texture2D(tex, v_texcoord); | ||
11 | pixColor.rgb = 1.0 - pixColor.rgb; | ||
12 | gl_FragColor = pixColor; | ||
13 | } \ No newline at end of file | ||
diff --git a/.config/hypr/shaders/solarized.frag b/.config/hypr/shaders/solarized.frag new file mode 100644 index 0000000..1c37f2c --- /dev/null +++ b/.config/hypr/shaders/solarized.frag | |||
@@ -0,0 +1,41 @@ | |||
1 | // -*- mode:c -*- | ||
2 | precision lowp float; | ||
3 | varying vec2 v_texcoord; | ||
4 | uniform sampler2D tex; | ||
5 | |||
6 | float distanceSquared(vec3 pixColor, vec3 solarizedColor) { | ||
7 | vec3 distanceVector = pixColor - solarizedColor; | ||
8 | return dot(distanceVector, distanceVector); | ||
9 | } | ||
10 | |||
11 | void main() { | ||
12 | vec3 solarized[16]; | ||
13 | solarized[0] = vec3(0.,0.169,0.212); | ||
14 | solarized[1] = vec3(0.027,0.212,0.259); | ||
15 | solarized[2] = vec3(0.345,0.431,0.459); | ||
16 | solarized[3] = vec3(0.396,0.482,0.514); | ||
17 | solarized[4] = vec3(0.514,0.58,0.588); | ||
18 | solarized[5] = vec3(0.576,0.631,0.631); | ||
19 | solarized[6] = vec3(0.933,0.91,0.835); | ||
20 | solarized[7] = vec3(0.992,0.965,0.89); | ||
21 | solarized[8] = vec3(0.71,0.537,0.); | ||
22 | solarized[9] = vec3(0.796,0.294,0.086); | ||
23 | solarized[10] = vec3(0.863,0.196,0.184); | ||
24 | solarized[11] = vec3(0.827,0.212,0.51); | ||
25 | solarized[12] = vec3(0.424,0.443,0.769); | ||
26 | solarized[13] = vec3(0.149,0.545,0.824); | ||
27 | solarized[14] = vec3(0.165,0.631,0.596); | ||
28 | solarized[15] = vec3(0.522,0.6,0.); | ||
29 | |||
30 | vec3 pixColor = vec3(texture2D(tex, v_texcoord)); | ||
31 | int closest = 0; | ||
32 | float closestDistanceSquared = distanceSquared(pixColor, solarized[0]); | ||
33 | for (int i = 1; i < 15; i++) { | ||
34 | float newDistanceSquared = distanceSquared(pixColor, solarized[i]); | ||
35 | if (newDistanceSquared < closestDistanceSquared) { | ||
36 | closest = i; | ||
37 | closestDistanceSquared = newDistanceSquared; | ||
38 | } | ||
39 | } | ||
40 | gl_FragColor = vec4(solarized[closest], 1.); | ||
41 | } | ||
diff --git a/.config/i3/config##h.luchs b/.config/i3/config##h.luchs deleted file mode 100644 index 0c9a999..0000000 --- a/.config/i3/config##h.luchs +++ /dev/null | |||
@@ -1,232 +0,0 @@ | |||
1 | # vim: filetype=i3config | ||
2 | # https://i3wm.org/docs/userguide.html | ||
3 | |||
4 | # set modifiers | ||
5 | set $mod Mod4 | ||
6 | set $alt Mod1 | ||
7 | |||
8 | # use mouse+$mod to drag floating windows to their wanted position | ||
9 | floating_modifier $alt | ||
10 | |||
11 | ## autostart | ||
12 | # exec --no-startup-id xsettingsd & | ||
13 | exec --no-startup-id picom -b | ||
14 | exec --no-startup-id flashfocus & | ||
15 | exec --no-startup-id nextcloud & | ||
16 | exec --no-startup-id copyq & | ||
17 | exec --no-startup-id clight & | ||
18 | exec --no-startup-id nm-applet & | ||
19 | exec --no-startup-id udiskie --automount --file-manager pcmanfm --tray --notify & | ||
20 | exec --no-startup-id /usr/lib/pam_kwallet_init | ||
21 | exec --no-startup-id remind -z -k'dunstify -i "calendar" "⏰ reminder!" "%s" &' ~/.reminders & | ||
22 | exec --no-startup-id /home/yigit/.local/bin/pulse-volume-watcher.py | xob -m 80 & | ||
23 | exec --no-startup-id $HOME/.config/polybar/launch.sh & | ||
24 | exec --no-startup-id ~/.fehbg & | ||
25 | |||
26 | exec --no-startup-id gebaard -b & | ||
27 | |||
28 | # swap caps lock and escape, set keyboard layout | ||
29 | exec --no-startup-id setxkbmap -model pc105 -layout us -variant colemak -option caps:backspace | ||
30 | |||
31 | # tap ctrl to esc, hold ctrl to ctrl | ||
32 | exec --no-startup-id xcape -e 'Control_L=Escape' & | ||
33 | |||
34 | # disable screensaver, beep and power saving | ||
35 | exec --no-startup-id xset -dpms & | ||
36 | exec --no-startup-id xset s off & | ||
37 | exec --no-startup-id xset -b & | ||
38 | |||
39 | exec --no-startup-id xinput set-prop "ELAN1200:00 04F3:3045 Touchpad" "libinput Natural Scrolling Enabled" 1 & | ||
40 | exec --no-startup-id xinput set-prop "ELAN1200:00 04F3:3045 Touchpad" "libinput Tapping Enabled" 1 & | ||
41 | |||
42 | gaps inner 5 | ||
43 | gaps outer 2 | ||
44 | |||
45 | # font for window titles | ||
46 | font pango:Iosevka 11 | ||
47 | |||
48 | ## bindings | ||
49 | ### dunstctl - dunst shortcuts have been deprecated | ||
50 | # close notifications with mod+x | ||
51 | bindcode $mod+53 exec --no-startup-id dunstctl close | ||
52 | bindcode $mod+shift+53 exec --no-startup-id dunstctl close-all | ||
53 | |||
54 | # give context menu with mod+o | ||
55 | bindcode $mod+47 exec --no-startup-id dunstctl context | ||
56 | |||
57 | # show history items with mod+0 (like the old times) | ||
58 | bindcode $mod+19 exec --no-startup-id dunstctl history-pop | ||
59 | |||
60 | # done, {task,time}warrior control suite | ||
61 | bindcode $mod+42 exec --no-startup-id ~/.local/bin/done | ||
62 | |||
63 | # type the contents of the clipboard with mod+p | ||
64 | bindcode --release $mod+27 exec --no-startup-id ~/.local/bin/type_clipboard.sh | ||
65 | |||
66 | # launch emoji picker with mod+c | ||
67 | bindcode $mod+54 exec --no-startup-id rofimoji --skin-tone neutral | ||
68 | |||
69 | # get the mouse out of the way with mod+y | ||
70 | bindcode $mod+32 exec --no-startup-id xdotool mousemove 896 5 | ||
71 | |||
72 | # bookmark from clipboard with mod+l | ||
73 | bindcode $mod+30 exec --no-startup-id ~/.local/bin/bukuadd_c | ||
74 | |||
75 | # swap caps lock and escape, set keyboard layout with mod+] | ||
76 | bindcode $mod+35 exec --no-startup-id "setxkbmap -model pc105 -layout us,us,tr -variant ,colemak, -option grp:alt_shift_toggle,caps:backspace" | ||
77 | |||
78 | # use flameshot with print screen | ||
79 | bindsym Print exec flameshot gui | ||
80 | |||
81 | # media keys | ||
82 | # TODO: test these for luchs keyboard <08-10-21, yigit> # | ||
83 | bindsym XF86AudioRaiseVolume exec --no-startup-id amixer set Master 2%+ | ||
84 | bindsym XF86AudioLowerVolume exec --no-startup-id amixer set Master 2%- | ||
85 | bindsym XF86AudioMute exec --no-startup-id amixer set Master toggle | ||
86 | bindsym XF86AudioPlay exec --no-startup-id playerctl play-pause # for spotify | ||
87 | bindsym XF86AudioPrev exec --no-startup-id playerctl previous | ||
88 | bindsym XF86AudioNext exec --no-startup-id playerctl next | ||
89 | bindsym XF86Tools exec --no-startup-id mpc toggle # for mpd/ncmpcpp | ||
90 | |||
91 | bindsym XF86MonBrightnessUp exec --no-startup-id xbacklight -inc 5 | ||
92 | bindsym XF86MonBrightnessDown exec --no-startup-id xbacklight -dec 5 | ||
93 | |||
94 | bindsym XF86TouchpadToggle exec --no-startup-id perl -e '{`xinput list-props "ELAN1200:00 04F3:3045 Touchpad"` =~ /^.*Device Enabled.+?(\d)$/m and {$1 ? `xinput --disable "ELAN1200:00 04F3:3045 Touchpad" && dunstify -a "touchpad" "disabled"` : `xinput --enable "ELAN1200:00 04F3:3045 Touchpad" && dunstify -a "touchpad" "enabled"`}} ' | ||
95 | |||
96 | # make the currently focused window a scratchpad | ||
97 | bindcode $mod+Shift+20 move scratchpad | ||
98 | |||
99 | # show the first scratchpad window | ||
100 | bindcode $mod+20 scratchpad show | ||
101 | |||
102 | # pause notifications for a while with mod+shift+y | ||
103 | bindcode $mod+Shift+32 exec ~/.local/bin/toggle_notifications.sh | ||
104 | |||
105 | ## shortcuts for frequent programs | ||
106 | |||
107 | # zotero on mod+shift+z | ||
108 | bindcode $mod+Shift+52 exec zotero | ||
109 | # thunar on mod+shift+t | ||
110 | bindcode $mod+Shift+41 exec thunar | ||
111 | # start a terminal | ||
112 | bindsym $mod+Return exec kitty | ||
113 | # start rofi with mod+s | ||
114 | bindcode $mod+40 exec rofi -show drun | ||
115 | # launch the poweroff menu | ||
116 | bindsym $mod+Shift+Escape exec --no-startup-id ~/.local/bin/power.sh | ||
117 | |||
118 | # kill focused window | ||
119 | bindcode $mod+Shift+24 kill | ||
120 | bindsym --whole-window $mod+button2 kill | ||
121 | |||
122 | # change focus on mod+hnei (qwerty hjkl) | ||
123 | bindcode $mod+43 focus left | ||
124 | bindcode $mod+44 focus down | ||
125 | bindcode $mod+45 focus up | ||
126 | bindcode $mod+46 focus right | ||
127 | |||
128 | # move focused window on mod+shift+hnei | ||
129 | bindcode $mod+Shift+43 move left | ||
130 | bindcode $mod+Shift+44 move down | ||
131 | bindcode $mod+Shift+45 move up | ||
132 | bindcode $mod+Shift+46 move right | ||
133 | |||
134 | # split in horizontal orientation with mod+b | ||
135 | bindcode $mod+56 split h | ||
136 | |||
137 | # split in vertical orientation with mod+v | ||
138 | bindcode $mod+55 split v | ||
139 | |||
140 | # enter fullscreen mode for the focused container with mod+t | ||
141 | bindcode $mod+41 fullscreen toggle | ||
142 | |||
143 | # change container layout (stacked, tabbed, toggle split) | ||
144 | bindcode $mod+39 layout stacking | ||
145 | bindcode $mod+25 layout tabbed | ||
146 | bindcode $mod+26 layout toggle split | ||
147 | |||
148 | # toggle tiling / floating | ||
149 | bindsym $mod+Shift+space floating toggle | ||
150 | |||
151 | # toggle sticky floating window with mod+a | ||
152 | bindcode $mod+38 sticky toggle | ||
153 | |||
154 | # change focus between tiling / floating windows | ||
155 | bindsym $mod+space focus mode_toggle | ||
156 | |||
157 | # Define names for default workspaces for which we configure key bindings later on. | ||
158 | # We use variables to avoid repeating the names in multiple places. | ||
159 | set $ws1 "1" | ||
160 | set $ws2 "2" | ||
161 | set $ws3 "3" | ||
162 | set $ws4 "4" | ||
163 | set $ws5 "5" | ||
164 | set $ws6 "6" | ||
165 | set $ws7 "7" | ||
166 | set $ws8 "8" | ||
167 | set $ws9 "9" | ||
168 | set $ws10 "10" | ||
169 | set $wszotero "zotero" | ||
170 | set $wsdesktop "desktop" | ||
171 | set $wsbrowser "browser" | ||
172 | |||
173 | # switch to workspace | ||
174 | bindsym $mod+1 workspace $ws1 | ||
175 | bindsym $mod+2 workspace $ws2 | ||
176 | bindsym $mod+3 workspace $ws3 | ||
177 | bindsym $mod+4 workspace $ws4 | ||
178 | bindsym $mod+5 workspace $ws5 | ||
179 | bindsym $mod+6 workspace $ws6 | ||
180 | bindsym $mod+7 workspace $ws7 | ||
181 | bindsym $mod+8 workspace $ws8 | ||
182 | bindsym $mod+9 workspace $ws9 | ||
183 | bindcode $mod+49 workspace $wszotero | ||
184 | bindcode $mod+60 workspace $wsdesktop | ||
185 | bindcode $mod+21 workspace $wsbrowser | ||
186 | |||
187 | # move focused container to workspace | ||
188 | bindsym $mod+Shift+1 move container to workspace $ws1 | ||
189 | bindsym $mod+Shift+2 move container to workspace $ws2 | ||
190 | bindsym $mod+Shift+3 move container to workspace $ws3 | ||
191 | bindsym $mod+Shift+4 move container to workspace $ws4 | ||
192 | bindsym $mod+Shift+5 move container to workspace $ws5 | ||
193 | bindsym $mod+Shift+6 move container to workspace $ws6 | ||
194 | bindsym $mod+Shift+7 move container to workspace $ws7 | ||
195 | bindsym $mod+Shift+8 move container to workspace $ws8 | ||
196 | bindsym $mod+Shift+9 move container to workspace $ws9 | ||
197 | bindcode $mod+Shift+49 move container to workspace $wszotero | ||
198 | bindcode $mod+Shift+60 move container to workspace $wsdesktop | ||
199 | bindcode $mod+Shift+21 move container to workspace $wsbrowser | ||
200 | |||
201 | # reload the configuration file | ||
202 | bindcode $mod+Shift+54 reload | ||
203 | # restart i3 inplace (preserves your layout/session, can be used to upgrade i3) | ||
204 | bindcode $mod+Shift+27 restart | ||
205 | |||
206 | default_border pixel 0 | ||
207 | default_floating_border pixel 0 | ||
208 | for_window [class="Zotero" instance="Toplevel" title="Quick Format Citation"] floating enable | ||
209 | for_window [class="Zotero" instance="Toplevel" title="Progress"] floating enable | ||
210 | for_window [class="Zotero" window_role="pref"] floating enable | ||
211 | for_window [class="zoom" title="Chat"] floating enable | ||
212 | for_window [class="Dia" window_role="toolbox_window"] floating enable | ||
213 | for_window [class="Pavucontrol" title="Volume Control"] floating enable | ||
214 | |||
215 | assign [class="^Brave-browser$"] $wsbrowser | ||
216 | assign [class="^Zotero$"] $wszotero | ||
217 | |||
218 | # class border background text indicator child_border | ||
219 | client.focused #ae81ff #080808 #85dc85 #ff5454 #ae81ff | ||
220 | client.focused_inactive #ae81ff #9e9e9e #080808 #ff5454 #5f676a | ||
221 | client.unfocused #ae81ff #323437 #b2b2b2 #ff5454 #222222 | ||
222 | client.urgent #ae81ff #900000 #b2b2b2 #ff5454 #900000 | ||
223 | client.placeholder #ae81ff #0c0c0c #b2b2b2 #ff5454 #0c0c0c | ||
224 | |||
225 | client.background #ffffff | ||
226 | |||
227 | # config | ||
228 | hide_edge_borders smart | ||
229 | workspace_auto_back_and_forth yes | ||
230 | focus_follows_mouse no | ||
231 | mouse_warping none | ||
232 | focus_wrapping no | ||
diff --git a/.mbsyncrc b/.config/isyncrc index 850f412..b4c8fd3 100644 --- a/.mbsyncrc +++ b/.config/isyncrc | |||
@@ -2,9 +2,9 @@ IMAPStore ceng_argor-remote | |||
2 | Host imap.ceng.metu.edu.tr | 2 | Host imap.ceng.metu.edu.tr |
3 | Port 993 | 3 | Port 993 |
4 | User yigit | 4 | User yigit |
5 | PassCmd "pass mutt-wizard-ceng_argor" | 5 | PassCmd "pass metu/ceng/argor" |
6 | AuthMechs LOGIN | 6 | AuthMechs LOGIN |
7 | SSLType IMAPS | 7 | TLSType IMAPS |
8 | CertificateFile /etc/ssl/certs/ca-certificates.crt | 8 | CertificateFile /etc/ssl/certs/ca-certificates.crt |
9 | 9 | ||
10 | MaildirStore ceng_argor-local | 10 | MaildirStore ceng_argor-local |
@@ -28,9 +28,9 @@ IMAPStore metu_argor-remote | |||
28 | Host imap.metu.edu.tr | 28 | Host imap.metu.edu.tr |
29 | Port 993 | 29 | Port 993 |
30 | User ysever | 30 | User ysever |
31 | PassCmd "pass mutt-wizard-metu_argor" | 31 | PassCmd "pass metu/personel" |
32 | AuthMechs LOGIN | 32 | AuthMechs LOGIN |
33 | SSLType IMAPS | 33 | TLSType IMAPS |
34 | CertificateFile /etc/ssl/certs/ca-certificates.crt | 34 | CertificateFile /etc/ssl/certs/ca-certificates.crt |
35 | 35 | ||
36 | MaildirStore metu_argor-local | 36 | MaildirStore metu_argor-local |
@@ -54,9 +54,9 @@ IMAPStore ceng_stu-remote | |||
54 | Host imap.ceng.metu.edu.tr | 54 | Host imap.ceng.metu.edu.tr |
55 | Port 993 | 55 | Port 993 |
56 | User e2482057 | 56 | User e2482057 |
57 | PassCmd "pass mutt-wizard-ceng_stu" | 57 | PassCmd "pass metu/ceng/student" |
58 | AuthMechs LOGIN | 58 | AuthMechs LOGIN |
59 | SSLType IMAPS | 59 | TLSType IMAPS |
60 | CertificateFile /etc/ssl/certs/ca-certificates.crt | 60 | CertificateFile /etc/ssl/certs/ca-certificates.crt |
61 | 61 | ||
62 | MaildirStore ceng_stu-local | 62 | MaildirStore ceng_stu-local |
@@ -80,9 +80,9 @@ IMAPStore metu_stu-remote | |||
80 | Host imap.metu.edu.tr | 80 | Host imap.metu.edu.tr |
81 | Port 993 | 81 | Port 993 |
82 | User e248205 | 82 | User e248205 |
83 | PassCmd "pass mutt-wizard-metu_stu" | 83 | PassCmd "pass metu/student" |
84 | AuthMechs LOGIN | 84 | AuthMechs LOGIN |
85 | SSLType IMAPS | 85 | TLSType IMAPS |
86 | CertificateFile /etc/ssl/certs/ca-certificates.crt | 86 | CertificateFile /etc/ssl/certs/ca-certificates.crt |
87 | 87 | ||
88 | MaildirStore metu_stu-local | 88 | MaildirStore metu_stu-local |
@@ -106,9 +106,9 @@ IMAPStore xyz-remote | |||
106 | Host mail.yigitsever.com | 106 | Host mail.yigitsever.com |
107 | Port 993 | 107 | Port 993 |
108 | User yigit | 108 | User yigit |
109 | PassCmd "pass mutt-wizard-xyz" | 109 | PassCmd "pass xyz/mail" |
110 | AuthMechs LOGIN | 110 | AuthMechs LOGIN |
111 | SSLType IMAPS | 111 | TLSType IMAPS |
112 | CertificateFile /etc/ssl/certs/ca-certificates.crt | 112 | CertificateFile /etc/ssl/certs/ca-certificates.crt |
113 | 113 | ||
114 | MaildirStore xyz-local | 114 | MaildirStore xyz-local |
@@ -127,4 +127,3 @@ SyncState * | |||
127 | MaxMessages 0 | 127 | MaxMessages 0 |
128 | ExpireUnread no | 128 | ExpireUnread no |
129 | # End profile | 129 | # End profile |
130 | |||
diff --git a/.config/msmtp/config b/.config/msmtp/config index 8b8e782..d3be082 100644 --- a/.config/msmtp/config +++ b/.config/msmtp/config | |||
@@ -10,7 +10,7 @@ domain mailhost.ceng.metu.edu.tr | |||
10 | port 587 | 10 | port 587 |
11 | from yigit@ceng.metu.edu.tr | 11 | from yigit@ceng.metu.edu.tr |
12 | user yigit | 12 | user yigit |
13 | passwordeval "pass mutt-wizard-ceng_argor" | 13 | passwordeval "pass metu/ceng/argor" |
14 | tls_starttls on | 14 | tls_starttls on |
15 | tls_certcheck off | 15 | tls_certcheck off |
16 | 16 | ||
@@ -19,7 +19,7 @@ host smtp.metu.edu.tr | |||
19 | port 465 | 19 | port 465 |
20 | from ysever@metu.edu.tr | 20 | from ysever@metu.edu.tr |
21 | user ysever | 21 | user ysever |
22 | passwordeval "pass mutt-wizard-metu_argor" | 22 | passwordeval "pass metu/personel" |
23 | tls_starttls off | 23 | tls_starttls off |
24 | 24 | ||
25 | account ceng_stu | 25 | account ceng_stu |
@@ -28,7 +28,7 @@ domain mailhost.ceng.metu.edu.tr | |||
28 | port 587 | 28 | port 587 |
29 | from e2482057@ceng.metu.edu.tr | 29 | from e2482057@ceng.metu.edu.tr |
30 | user e2482057 | 30 | user e2482057 |
31 | passwordeval "pass mutt-wizard-ceng_stu" | 31 | passwordeval "pass metu/ceng/student" |
32 | tls_certcheck off | 32 | tls_certcheck off |
33 | 33 | ||
34 | account metu_stu | 34 | account metu_stu |
@@ -36,7 +36,7 @@ host smtp.metu.edu.tr | |||
36 | port 465 | 36 | port 465 |
37 | from e248205@metu.edu.tr | 37 | from e248205@metu.edu.tr |
38 | user e248205 | 38 | user e248205 |
39 | passwordeval "pass mutt-wizard-metu_stu" | 39 | passwordeval "pass metu/student" |
40 | tls_starttls off | 40 | tls_starttls off |
41 | 41 | ||
42 | account xyz | 42 | account xyz |
@@ -44,4 +44,4 @@ host mail.yigitsever.com | |||
44 | port 587 | 44 | port 587 |
45 | from yigit@yigitsever.com | 45 | from yigit@yigitsever.com |
46 | user yigit | 46 | user yigit |
47 | passwordeval "pass mutt-wizard-xyz" | 47 | passwordeval "pass xyz/mail" |
diff --git a/.config/mutt/accounts/1-ceng_argor.muttrc b/.config/mutt/accounts/1-ceng_argor.muttrc index 1656992..343adcf 100644 --- a/.config/mutt/accounts/1-ceng_argor.muttrc +++ b/.config/mutt/accounts/1-ceng_argor.muttrc | |||
@@ -9,6 +9,9 @@ set header_cache = /home/yigit/.cache/mutt-wizard/ceng_argor/headers | |||
9 | set message_cachedir = /home/yigit/.cache/mutt-wizard/ceng_argor/bodies | 9 | set message_cachedir = /home/yigit/.cache/mutt-wizard/ceng_argor/bodies |
10 | set mbox_type = Maildir | 10 | set mbox_type = Maildir |
11 | 11 | ||
12 | # use very high $read_inc to speed up reading hcache'd maildirs | ||
13 | folder-hook . 'set read_inc=1000' | ||
14 | |||
12 | bind index,pager gg noop | 15 | bind index,pager gg noop |
13 | bind index,pager g noop | 16 | bind index,pager g noop |
14 | bind index,pager M noop | 17 | bind index,pager M noop |
diff --git a/.config/mutt/accounts/2-metu_argor.muttrc b/.config/mutt/accounts/2-metu_argor.muttrc index cbbb53a..db3f73a 100644 --- a/.config/mutt/accounts/2-metu_argor.muttrc +++ b/.config/mutt/accounts/2-metu_argor.muttrc | |||
@@ -9,6 +9,9 @@ set header_cache = /home/yigit/.cache/mutt-wizard/metu_argor/headers | |||
9 | set message_cachedir = /home/yigit/.cache/mutt-wizard/metu_argor/bodies | 9 | set message_cachedir = /home/yigit/.cache/mutt-wizard/metu_argor/bodies |
10 | set mbox_type = Maildir | 10 | set mbox_type = Maildir |
11 | 11 | ||
12 | # use very high $read_inc to speed up reading hcache'd maildirs | ||
13 | folder-hook . 'set read_inc=1000' | ||
14 | |||
12 | bind index,pager gg noop | 15 | bind index,pager gg noop |
13 | bind index,pager g noop | 16 | bind index,pager g noop |
14 | bind index,pager M noop | 17 | bind index,pager M noop |
diff --git a/.config/mutt/accounts/3-ceng_stu.muttrc b/.config/mutt/accounts/3-ceng_stu.muttrc index 5e7472c..1205084 100644 --- a/.config/mutt/accounts/3-ceng_stu.muttrc +++ b/.config/mutt/accounts/3-ceng_stu.muttrc | |||
@@ -9,6 +9,9 @@ set header_cache = /home/yigit/.cache/mutt-wizard/ceng_stu/headers | |||
9 | set message_cachedir = /home/yigit/.cache/mutt-wizard/ceng_stu/bodies | 9 | set message_cachedir = /home/yigit/.cache/mutt-wizard/ceng_stu/bodies |
10 | set mbox_type = Maildir | 10 | set mbox_type = Maildir |
11 | 11 | ||
12 | # use very high $read_inc to speed up reading hcache'd maildirs | ||
13 | folder-hook . 'set read_inc=1000' | ||
14 | |||
12 | bind index,pager gg noop | 15 | bind index,pager gg noop |
13 | bind index,pager g noop | 16 | bind index,pager g noop |
14 | bind index,pager M noop | 17 | bind index,pager M noop |
diff --git a/.config/mutt/accounts/4-metu_stu.muttrc b/.config/mutt/accounts/4-metu_stu.muttrc index 959586d..c3cc178 100644 --- a/.config/mutt/accounts/4-metu_stu.muttrc +++ b/.config/mutt/accounts/4-metu_stu.muttrc | |||
@@ -9,6 +9,9 @@ set header_cache = /home/yigit/.cache/mutt-wizard/metu_stu/headers | |||
9 | set message_cachedir = /home/yigit/.cache/mutt-wizard/metu_stu/bodies | 9 | set message_cachedir = /home/yigit/.cache/mutt-wizard/metu_stu/bodies |
10 | set mbox_type = Maildir | 10 | set mbox_type = Maildir |
11 | 11 | ||
12 | # use very high $read_inc to speed up reading hcache'd maildirs | ||
13 | folder-hook . 'set read_inc=1000' | ||
14 | |||
12 | bind index,pager gg noop | 15 | bind index,pager gg noop |
13 | bind index,pager g noop | 16 | bind index,pager g noop |
14 | bind index,pager M noop | 17 | bind index,pager M noop |
diff --git a/.config/mutt/accounts/5-xyz.muttrc b/.config/mutt/accounts/5-xyz.muttrc index bf56c52..108fe51 100644 --- a/.config/mutt/accounts/5-xyz.muttrc +++ b/.config/mutt/accounts/5-xyz.muttrc | |||
@@ -9,6 +9,9 @@ set header_cache = /home/yigit/.cache/mutt-wizard/xyz/headers | |||
9 | set message_cachedir = /home/yigit/.cache/mutt-wizard/xyz/bodies | 9 | set message_cachedir = /home/yigit/.cache/mutt-wizard/xyz/bodies |
10 | set mbox_type = Maildir | 10 | set mbox_type = Maildir |
11 | 11 | ||
12 | # use very high $read_inc to speed up reading hcache'd maildirs | ||
13 | folder-hook . 'set read_inc=1000' | ||
14 | |||
12 | bind index,pager gg noop | 15 | bind index,pager gg noop |
13 | bind index,pager g noop | 16 | bind index,pager g noop |
14 | bind index,pager M noop | 17 | bind index,pager M noop |
diff --git a/.config/mutt/mailcap b/.config/mutt/mailcap index 3646d07..b355f32 100644 --- a/.config/mutt/mailcap +++ b/.config/mutt/mailcap | |||
@@ -7,5 +7,3 @@ audio/*; mpv %s ; | |||
7 | application/pdf; openfile %s ; | 7 | application/pdf; openfile %s ; |
8 | application/pgp-encrypted; gpg -d '%s'; copiousoutput; | 8 | application/pgp-encrypted; gpg -d '%s'; copiousoutput; |
9 | application/pgp-keys; gpg --import '%s'; copiousoutput; | 9 | application/pgp-keys; gpg --import '%s'; copiousoutput; |
10 | text/calendar; mutt-ics; copiousoutput | ||
11 | application/ics; mutt-ics; copiousoutput | ||
diff --git a/.config/mutt/muttrc b/.config/mutt/muttrc index 7b82f89..2b6b5ca 100644 --- a/.config/mutt/muttrc +++ b/.config/mutt/muttrc | |||
@@ -13,10 +13,16 @@ set fcc_attach # save attachments with the body | |||
13 | set forward_format = "Fwd: %s" # format of subject when forwarding | 13 | set forward_format = "Fwd: %s" # format of subject when forwarding |
14 | set forward_quote # include message in forwards | 14 | set forward_quote # include message in forwards |
15 | set reverse_name # reply as whomever it was to | 15 | set reverse_name # reply as whomever it was to |
16 | set mail_check=60 # to avoid lags using IMAP with some email providers (yahoo for example) | 16 | |
17 | auto_view text/html # automatically show html (mailcap uses w3m) | 17 | set mail_check = 60 # to avoid lags using IMAP with some email providers |
18 | set timeout = 60 | ||
19 | set sleep_time = 0 | ||
20 | set mail_check = 0 | ||
21 | |||
22 | auto_view text/html | ||
18 | auto_view application/pgp-encrypted | 23 | auto_view application/pgp-encrypted |
19 | auto_view text/calendar application/ics | 24 | auto_view text/calendar application/ics |
25 | |||
20 | alternative_order text/plain text/enriched text/html | 26 | alternative_order text/plain text/enriched text/html |
21 | bind index,pager i noop | 27 | bind index,pager i noop |
22 | bind index,pager g noop | 28 | bind index,pager g noop |
diff --git a/.config/nvchecker/nvchecker.toml b/.config/nvchecker/nvchecker.toml index 6eca418..3c0a3f1 100644 --- a/.config/nvchecker/nvchecker.toml +++ b/.config/nvchecker/nvchecker.toml | |||
@@ -4,11 +4,6 @@ newver = "new_ver.json" | |||
4 | user_agent = "yigitsever" | 4 | user_agent = "yigitsever" |
5 | keyfile = "keyfile.toml" | 5 | keyfile = "keyfile.toml" |
6 | 6 | ||
7 | [metadata-cleaner] | ||
8 | source = "gitlab" | ||
9 | gitlab = "rmnvgr/metadata-cleaner" | ||
10 | use_max_tag = true | ||
11 | |||
12 | [thorium] | 7 | [thorium] |
13 | source = "github" | 8 | source = "github" |
14 | github = "edrlab/thorium-reader" | 9 | github = "edrlab/thorium-reader" |
@@ -91,7 +86,7 @@ use_latest_release = true | |||
91 | 86 | ||
92 | [pfetch] | 87 | [pfetch] |
93 | source = "github" | 88 | source = "github" |
94 | github = "dylanaraps/pfetch" | 89 | github = "Un1q32/pfetch" |
95 | use_latest_release = true | 90 | use_latest_release = true |
96 | 91 | ||
97 | [httpx] | 92 | [httpx] |
@@ -129,14 +124,9 @@ source = "github" | |||
129 | github = "LemonBoy/ldm" | 124 | github = "LemonBoy/ldm" |
130 | use_latest_release = true | 125 | use_latest_release = true |
131 | 126 | ||
132 | [gourmand] | ||
133 | source = "github" | ||
134 | github = "GourmandRecipeManager/gourmand" | ||
135 | use_latest_release = true | ||
136 | |||
137 | [python-html-text] | 127 | [python-html-text] |
138 | source = "github" | 128 | source = "github" |
139 | github = "TeamHG-Memex/html-text" | 129 | github = "zytedata/html-text" |
140 | use_latest_tag = true | 130 | use_latest_tag = true |
141 | 131 | ||
142 | [python-jstyleson] | 132 | [python-jstyleson] |
@@ -147,16 +137,6 @@ pypi = "jstyleson" | |||
147 | source = "pypi" | 137 | source = "pypi" |
148 | pypi = "mf2py" | 138 | pypi = "mf2py" |
149 | 139 | ||
150 | [python-extruct] | ||
151 | source = "github" | ||
152 | github = "scrapinghub/extruct" | ||
153 | use_latest_tag = true | ||
154 | |||
155 | [helmsman] | ||
156 | source = "github" | ||
157 | github = "Praqma/helmsman" | ||
158 | use_latest_release = true | ||
159 | |||
160 | [datavzrd] | 140 | [datavzrd] |
161 | source = "github" | 141 | source = "github" |
162 | github = "datavzrd/datavzrd" | 142 | github = "datavzrd/datavzrd" |
@@ -177,3 +157,32 @@ source = "github" | |||
177 | github = "lcallarec/live-chart" | 157 | github = "lcallarec/live-chart" |
178 | use_latest_release = true | 158 | use_latest_release = true |
179 | 159 | ||
160 | [tex-fmt] | ||
161 | source = "github" | ||
162 | github = "WGUNDERWOOD/tex-fmt" | ||
163 | use_latest_release = true | ||
164 | |||
165 | [tlsx] | ||
166 | source = "github" | ||
167 | github = "projectdiscovery/tlsx" | ||
168 | use_latest_release = true | ||
169 | |||
170 | [cvemap] | ||
171 | source = "github" | ||
172 | github = "projectdiscovery/cvemap" | ||
173 | use_latest_release = true | ||
174 | |||
175 | [puredns] | ||
176 | source = "github" | ||
177 | github = "d3mondev/puredns" | ||
178 | use_latest_release = true | ||
179 | |||
180 | [py-spy] | ||
181 | source = "github" | ||
182 | github = "benfred/py-spy" | ||
183 | use_latest_release = true | ||
184 | |||
185 | [xq] | ||
186 | source = "github" | ||
187 | github = "sibprogrammer/xq" | ||
188 | use_latest_release = true | ||
diff --git a/.config/nvim/after/ftplugin/rust.vim b/.config/nvim/after/ftplugin/rust.vim deleted file mode 100644 index fb601d1..0000000 --- a/.config/nvim/after/ftplugin/rust.vim +++ /dev/null | |||
@@ -1,3 +0,0 @@ | |||
1 | setlocal tags=./rusty-tags.vi;/ | ||
2 | |||
3 | autocmd BufWritePost *.rs :silent! exec "!rusty-tags vi --quiet --start-dir=" . expand('%:p:h') . "&" | redraw! | ||
diff --git a/.config/nvim/after/ftplugin/tex.lua b/.config/nvim/after/ftplugin/tex.lua index 2a79358..2cd03a7 100644 --- a/.config/nvim/after/ftplugin/tex.lua +++ b/.config/nvim/after/ftplugin/tex.lua | |||
@@ -1,24 +1,29 @@ | |||
1 | require("nvim-surround").buffer_setup({ | 1 | require("nvim-surround").buffer_setup({ |
2 | surrounds = { | 2 | surrounds = { |
3 | ["B"] = { | 3 | ["K"] = { |
4 | add = function() | 4 | add = { "\\textbf{", "}" }, |
5 | return { { '\\textbf{' }, { '}' } } | 5 | find = "\\textbf%b{}", |
6 | end | 6 | delete = "^(\\textbf{)().-(})()$", |
7 | }, | 7 | }, |
8 | ["E"] = { | 8 | ["E"] = { |
9 | add = function() | 9 | add = { "\\emph{", "}" }, |
10 | return { { '\\emph{' }, { '}' } } | 10 | find = "\\emph%b{}", |
11 | end | 11 | delete = "^(\\emph{)().-(})()$", |
12 | }, | 12 | }, |
13 | ["T"] = { | 13 | ["T"] = { |
14 | add = function() | 14 | add = { "\\texttt{", "}" }, |
15 | return { { '\\texttt{' }, { '}' } } | 15 | find = "\\texttt%b{}", |
16 | end | 16 | delete = "^(\\texttt{)().-(})()$", |
17 | }, | 17 | }, |
18 | ['"'] = { | 18 | ['"'] = { |
19 | add = function() | 19 | add = { "\\enquote{", "}" }, |
20 | return { { '\\enquote{' }, { '}' } } | 20 | find = "\\enquote%b{}", |
21 | end, | 21 | delete = "^(\\enquote{)().-(})()$", |
22 | }, | ||
23 | ['P'] = { | ||
24 | add = { "\\paragraph{", "}" }, | ||
25 | find = "\\paragraph%b{}", | ||
26 | delete = "^(\\paragraph{)().-(})()$", | ||
22 | }, | 27 | }, |
23 | } | 28 | } |
24 | }) | 29 | }) |
diff --git a/.config/nvim/after/plugin/autocmds.vim b/.config/nvim/after/plugin/autocmds.vim index d249bef..21c7bc4 100644 --- a/.config/nvim/after/plugin/autocmds.vim +++ b/.config/nvim/after/plugin/autocmds.vim | |||
@@ -1,19 +1,7 @@ | |||
1 | " I don't know how to port this yet | 1 | " I don't know how to port this yet |
2 | autocmd BufRead,BufWrite * if ! &bin | silent! %s/\s\+$//ge | endif | 2 | autocmd BufRead,BufWrite * if ! &bin | silent! %s/\s\+$//ge | endif |
3 | 3 | ||
4 | autocmd BufNewFile,BufRead /tmp/neomutt* set noautoindent filetype=mail wm=0 tw=80 | 4 | augroup vimwiki |
5 | |||
6 | augroup bukugroup | ||
7 | au! BufRead,BufNewFile,BufEnter buku-edit-* set filetype=buku | ||
8 | augroup END | ||
9 | |||
10 | " Restore last position | ||
11 | autocmd BufReadPost * | ||
12 | \ if line("'\"") >= 1 && line("'\"") <= line("$") && &ft !~# 'commit' | ||
13 | \ | exe "normal! g`\"" | ||
14 | \ | endif | ||
15 | |||
16 | augroup pkgbuild | ||
17 | autocmd! | 5 | autocmd! |
18 | autocmd BufRead,BufNewFile PKGBUILD set filetype=PKGBUILD | 6 | autocmd BufRead,BufNewFile *.wiki set filetype=vimwiki |
19 | augroup END | 7 | augroup END |
diff --git a/.config/nvim/after/plugin/functions.vim b/.config/nvim/after/plugin/functions.vim index 87a1072..415ad51 100644 --- a/.config/nvim/after/plugin/functions.vim +++ b/.config/nvim/after/plugin/functions.vim | |||
@@ -11,10 +11,10 @@ function! CreatePaper(citekey) | |||
11 | exe "e! " . fnameescape("~/nextcloud/personal_wiki/text/papers/" . a:citekey . ".wiki") | 11 | exe "e! " . fnameescape("~/nextcloud/personal_wiki/text/papers/" . a:citekey . ".wiki") |
12 | 12 | ||
13 | let l:timestap="%date " . strftime("%F") | 13 | let l:timestap="%date " . strftime("%F") |
14 | let l:text="= Came From =\n\n= Takeaways =\n\n= Might Go To =\n\n" | 14 | let l:title="%title " |
15 | 15 | ||
16 | put! =l:timestap | 16 | put! =l:timestap |
17 | put =l:text | 17 | put =l:title |
18 | endfunction | 18 | endfunction |
19 | 19 | ||
20 | function! CreateReference(citekey) | 20 | function! CreateReference(citekey) |
diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json deleted file mode 100644 index fe1e69c..0000000 --- a/.config/nvim/lazy-lock.json +++ /dev/null | |||
@@ -1,53 +0,0 @@ | |||
1 | { | ||
2 | "Comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" }, | ||
3 | "LuaSnip": { "branch": "master", "commit": "8ae1dedd988eb56441b7858bd1e8554dfadaa46d" }, | ||
4 | "barbar.nvim": { "branch": "master", "commit": "71ac376acd000743146b1e08e62151b4d887bbac" }, | ||
5 | "catppuccin": { "branch": "main", "commit": "9703f227bfab20d04bcee62d2f08f1795723b4ae" }, | ||
6 | "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, | ||
7 | "cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" }, | ||
8 | "cmp-nvim-lsp-signature-help": { "branch": "main", "commit": "3d8912ebeb56e5ae08ef0906e3a54de1c66b92f1" }, | ||
9 | "cmp-nvim-lua": { "branch": "main", "commit": "f12408bdb54c39c23e67cab726264c10db33ada8" }, | ||
10 | "cmp-omni": { "branch": "main", "commit": "4ef610bbd85a5ee4e97e09450c0daecbdc60de86" }, | ||
11 | "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, | ||
12 | "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, | ||
13 | "dashboard-nvim": { "branch": "master", "commit": "413442b12d85315fc626c44a0ce4929b213ef604" }, | ||
14 | "dial.nvim": { "branch": "master", "commit": "27eb570085db2ef44bff4f620d3806039184651c" }, | ||
15 | "fidget.nvim": { "branch": "main", "commit": "4e854f3299e21d1c18279add340428a97520fc44" }, | ||
16 | "gitsigns.nvim": { "branch": "main", "commit": "2c2463dbd82eddd7dbab881c3a62cfbfbe3c67ae" }, | ||
17 | "indent-blankline.nvim": { "branch": "master", "commit": "821a7acd88587d966f7e464b0b3031dfe7f5680c" }, | ||
18 | "lazy.nvim": { "branch": "main", "commit": "aedcd79811d491b60d0a6577a9c1701063c2a609" }, | ||
19 | "leap.nvim": { "branch": "main", "commit": "52f7ce4fcc1764caac77cf4d43c2c4f5fb42d517" }, | ||
20 | "ltex-extra.nvim": { "branch": "master", "commit": "42dd3572cb09b52a137e91e515f2dff5eb631b1e" }, | ||
21 | "lualine.nvim": { "branch": "master", "commit": "7d131a8d3ba5016229e8a1d08bf8782acea98852" }, | ||
22 | "luasnip-snippets": { "branch": "main", "commit": "94307234ab0b1f37b154e564c80a15f1d5b04f82" }, | ||
23 | "neodev.nvim": { "branch": "main", "commit": "de3685b8c1cd439dd96b7958793f6f381f98652d" }, | ||
24 | "nvim-autopairs": { "branch": "master", "commit": "2e8a10c5fc0dcaf8296a5f1a7077efcd37065cc8" }, | ||
25 | "nvim-cmp": { "branch": "main", "commit": "04e0ca376d6abdbfc8b52180f8ea236cbfddf782" }, | ||
26 | "nvim-lspconfig": { "branch": "master", "commit": "d1bab4cf4b69e49d6058028fd933d8ef5e74e680" }, | ||
27 | "nvim-surround": { "branch": "main", "commit": "703ec63aa798e5e07d309b35e42def34bebe0174" }, | ||
28 | "nvim-tree.lua": { "branch": "master", "commit": "863cf832ceb0b2377c913b7696dd7d64f4978941" }, | ||
29 | "nvim-treesitter": { "branch": "master", "commit": "17d68ac13c902f55253b7facb47df4c0ae532575" }, | ||
30 | "nvim-treesitter-textobjects": { "branch": "master", "commit": "7f00d94543f1fd37cab2afa2e9a6cd54e1c6b9ef" }, | ||
31 | "nvim-ufo": { "branch": "main", "commit": "553d8a9c611caa9f020556d4a26b760698e5b81b" }, | ||
32 | "nvim-web-devicons": { "branch": "master", "commit": "7f30f2da3c3641841ceb0e2c150281f624445e8f" }, | ||
33 | "plenary.nvim": { "branch": "master", "commit": "4f71c0c4a196ceb656c824a70792f3df3ce6bb6d" }, | ||
34 | "promise-async": { "branch": "main", "commit": "94f6f03c6c1e2aab551aacdf0c1e597a7269abb6" }, | ||
35 | "rust-tools.nvim": { "branch": "master", "commit": "676187908a1ce35ffcd727c654ed68d851299d3e" }, | ||
36 | "substitute.nvim": { "branch": "main", "commit": "17ffaeb5a1dc2dbef39cf0865d8a4b6000836714" }, | ||
37 | "tabular": { "branch": "master", "commit": "339091ac4dd1f17e225fe7d57b48aff55f99b23a" }, | ||
38 | "targets.vim": { "branch": "master", "commit": "642d3a4ce306264b05ea3219920b13ea80931767" }, | ||
39 | "telescope-fzf-native.nvim": { "branch": "main", "commit": "6c921ca12321edaa773e324ef64ea301a1d0da62" }, | ||
40 | "telescope.nvim": { "branch": "master", "commit": "b744cf59752aaa01561afb4223006de26f3836fd" }, | ||
41 | "trouble.nvim": { "branch": "main", "commit": "f1168feada93c0154ede4d1fe9183bf69bac54ea" }, | ||
42 | "turkish-deasciifier.vim": { "branch": "master", "commit": "5b3a0bfef7424d218df7ab3dac8ee9dab42a105e" }, | ||
43 | "vim-characterize": { "branch": "master", "commit": "7fc5b75e7a9e46676cf736b56d99dd32004ff3d6" }, | ||
44 | "vim-cutlass": { "branch": "master", "commit": "7afd649415541634c8ce317fafbc31cd19d57589" }, | ||
45 | "vim-fugitive": { "branch": "master", "commit": "011cf4fcb93a9649ffc6dcdff56ef948f5d0f7cc" }, | ||
46 | "vim-illuminate": { "branch": "master", "commit": "305bf07b919ac526deb5193280379e2f8b599926" }, | ||
47 | "vim-move": { "branch": "master", "commit": "3c4195de0748da9bba25c54d78d959d349e93c55" }, | ||
48 | "vim-repeat": { "branch": "master", "commit": "24afe922e6a05891756ecf331f39a1f6743d3d5a" }, | ||
49 | "vim-unimpaired": { "branch": "master", "commit": "6d44a6dc2ec34607c41ec78acf81657248580bf1" }, | ||
50 | "vimtex": { "branch": "master", "commit": "9df79e15bf035d1cfb32c11fffed38dd7b6a0501" }, | ||
51 | "vimwiki": { "branch": "dev", "commit": "5f0a6c7523df3a15cc0331dc050a680ee4ddff04" }, | ||
52 | "yanky.nvim": { "branch": "main", "commit": "7c5cbf0122ff2dfbb6a92f14885894f65949cc8b" } | ||
53 | } \ No newline at end of file | ||
diff --git a/.config/nvim/lua/core/keymaps.lua b/.config/nvim/lua/core/keymaps.lua index 95e5fcd..318cfc7 100644 --- a/.config/nvim/lua/core/keymaps.lua +++ b/.config/nvim/lua/core/keymaps.lua | |||
@@ -49,6 +49,11 @@ map("n", "<leader>lp", "gewi[[/papers/<ESC>Ea]]<ESC>", "vimwiki: link wrap word | |||
49 | -- call CreateReference on word below cursor | 49 | -- call CreateReference on word below cursor |
50 | map("n", "<leader>nr", '<cmd>call CreateReference(expand("<cword>"))<CR>', "vimwiki: new reference word under cursor") | 50 | map("n", "<leader>nr", '<cmd>call CreateReference(expand("<cword>"))<CR>', "vimwiki: new reference word under cursor") |
51 | 51 | ||
52 | -- nr2char(10) is, of course, a newline character | ||
53 | map("n", "<leader>yp", | ||
54 | "<cmd>call setreg('+', expand('%:h') . '/' . expand('%:t') . ':' . line('.') . nr2char(10) . getline('.'))<CR>", | ||
55 | "yank the current line contents, filename and line number to clipboard") | ||
56 | |||
52 | -- create a new note | 57 | -- create a new note |
53 | map("n", "<leader>nn", "<cmd>call CreateNote()<CR>", "vimwiki: new note for slipbox") | 58 | map("n", "<leader>nn", "<cmd>call CreateNote()<CR>", "vimwiki: new note for slipbox") |
54 | 59 | ||
@@ -70,6 +75,7 @@ map('n', "'", '`') | |||
70 | map("n", "n", "nzzzv") | 75 | map("n", "n", "nzzzv") |
71 | map("n", "N", "Nzzzv") | 76 | map("n", "N", "Nzzzv") |
72 | 77 | ||
78 | |||
73 | -- switch between light and dark modes | 79 | -- switch between light and dark modes |
74 | map("n", "<leader>ut", function() | 80 | map("n", "<leader>ut", function() |
75 | if vim.o.background == "dark" then | 81 | if vim.o.background == "dark" then |
diff --git a/.config/nvim/lua/core/lazy.lua b/.config/nvim/lua/core/lazy.lua index 8a91029..815953f 100644 --- a/.config/nvim/lua/core/lazy.lua +++ b/.config/nvim/lua/core/lazy.lua | |||
@@ -1,14 +1,17 @@ | |||
1 | -- install lazy.nvim if not already installed | 1 | -- install lazy.nvim if not already installed |
2 | local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" | 2 | local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" |
3 | if not vim.loop.fs_stat(lazypath) then | 3 | if not (vim.uv or vim.loop).fs_stat(lazypath) then |
4 | vim.fn.system({ | 4 | local lazyrepo = "https://github.com/folke/lazy.nvim.git" |
5 | "git", | 5 | local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath }) |
6 | "clone", | 6 | if vim.v.shell_error ~= 0 then |
7 | "--filter=blob:none", | 7 | vim.api.nvim_echo({ |
8 | "https://github.com/folke/lazy.nvim.git", | 8 | { "Failed to clone lazy.nvim:\n", "ErrorMsg" }, |
9 | "--branch=stable", -- latest stable release | 9 | { out, "WarningMsg" }, |
10 | lazypath, | 10 | { "\nPress any key to exit..." }, |
11 | }) | 11 | }, true, {}) |
12 | vim.fn.getchar() | ||
13 | os.exit(1) | ||
14 | end | ||
12 | end | 15 | end |
13 | vim.opt.rtp:prepend(lazypath) | 16 | vim.opt.rtp:prepend(lazypath) |
14 | 17 | ||
diff --git a/.config/nvim/lua/core/options.lua b/.config/nvim/lua/core/options.lua index 1a45b8f..9962f4f 100644 --- a/.config/nvim/lua/core/options.lua +++ b/.config/nvim/lua/core/options.lua | |||
@@ -63,6 +63,8 @@ local opts = { | |||
63 | -- switch case labels | 63 | -- switch case labels |
64 | cinoptions = "l1", | 64 | cinoptions = "l1", |
65 | 65 | ||
66 | signcolumn = "yes:1", | ||
67 | |||
66 | } | 68 | } |
67 | 69 | ||
68 | for opt, val in pairs(opts) do | 70 | for opt, val in pairs(opts) do |
diff --git a/.config/nvim/lua/helpers/autocmds.lua b/.config/nvim/lua/helpers/autocmds.lua index 11f4480..7461090 100644 --- a/.config/nvim/lua/helpers/autocmds.lua +++ b/.config/nvim/lua/helpers/autocmds.lua | |||
@@ -29,3 +29,130 @@ vim.api.nvim_create_autocmd("VimResized", { | |||
29 | }, | 29 | }, |
30 | command = "wincmd =", | 30 | command = "wincmd =", |
31 | }) | 31 | }) |
32 | |||
33 | -- https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/autocmds.lua | ||
34 | -- Set typst filetype | ||
35 | vim.api.nvim_create_autocmd( | ||
36 | { | ||
37 | "BufNewFile", | ||
38 | "BufRead", | ||
39 | }, | ||
40 | { | ||
41 | group = augroup("typst"), | ||
42 | pattern = "*.typ", | ||
43 | callback = function() | ||
44 | local buf = vim.api.nvim_get_current_buf() | ||
45 | vim.api.nvim_set_option_value("filetype", "typst", { buf = buf }) | ||
46 | vim.api.nvim_set_option_value("shiftwidth", 2, { buf = buf }) | ||
47 | end | ||
48 | } | ||
49 | ) | ||
50 | |||
51 | -- Set PKGBUILD filetype | ||
52 | vim.api.nvim_create_autocmd( | ||
53 | { | ||
54 | "BufNewFile", | ||
55 | "BufRead", | ||
56 | }, | ||
57 | { | ||
58 | group = augroup("pkgbuild"), | ||
59 | pattern = "PKGBUILD", | ||
60 | callback = function() | ||
61 | local buf = vim.api.nvim_get_current_buf() | ||
62 | vim.api.nvim_set_option_value("filetype", "PKGBUILD", { buf = buf }) | ||
63 | end | ||
64 | } | ||
65 | ) | ||
66 | |||
67 | -- Set buku-edit filetype | ||
68 | vim.api.nvim_create_autocmd( | ||
69 | { | ||
70 | "BufNewFile", | ||
71 | "BufRead", | ||
72 | }, | ||
73 | { | ||
74 | group = augroup("buku-edit"), | ||
75 | pattern = "buku-edit-*", | ||
76 | callback = function() | ||
77 | local buf = vim.api.nvim_get_current_buf() | ||
78 | vim.api.nvim_set_option_value("filetype", "buku", { buf = buf }) | ||
79 | end | ||
80 | } | ||
81 | ) | ||
82 | |||
83 | -- Set mail filetype | ||
84 | vim.api.nvim_create_autocmd( | ||
85 | { | ||
86 | "BufNewFile", | ||
87 | "BufRead", | ||
88 | }, | ||
89 | { | ||
90 | group = augroup("mail"), | ||
91 | pattern = "/tmp/neomutt*", | ||
92 | callback = function() | ||
93 | local buf = vim.api.nvim_get_current_buf() | ||
94 | vim.api.nvim_set_option_value("autoindent", false, { buf = buf }) | ||
95 | vim.api.nvim_set_option_value("filetype", "mail", { buf = buf }) | ||
96 | vim.api.nvim_set_option_value("wrapmargin", 0, { buf = buf }) | ||
97 | vim.api.nvim_set_option_value("textwidth", 80, { buf = buf }) | ||
98 | end | ||
99 | } | ||
100 | ) | ||
101 | |||
102 | -- Resize splits if window got resized | ||
103 | vim.api.nvim_create_autocmd({ "VimResized" }, { | ||
104 | group = augroup("resize_splits"), | ||
105 | callback = function() | ||
106 | local current_tab = vim.fn.tabpagenr() | ||
107 | vim.cmd("tabdo wincmd =") | ||
108 | vim.cmd("tabnext " .. current_tab) | ||
109 | end, | ||
110 | }) | ||
111 | |||
112 | -- close some filetypes with <q> | ||
113 | vim.api.nvim_create_autocmd("FileType", { | ||
114 | group = augroup("close_with_q"), | ||
115 | pattern = { | ||
116 | "PlenaryTestPopup", | ||
117 | "checkhealth", | ||
118 | "dbout", | ||
119 | "gitsigns-blame", | ||
120 | "grug-far", | ||
121 | "help", | ||
122 | "lspinfo", | ||
123 | "neotest-output", | ||
124 | "neotest-output-panel", | ||
125 | "neotest-summary", | ||
126 | "notify", | ||
127 | "qf", | ||
128 | "snacks_win", | ||
129 | "spectre_panel", | ||
130 | "startuptime", | ||
131 | "tsplayground", | ||
132 | }, | ||
133 | callback = function(event) | ||
134 | vim.bo[event.buf].buflisted = false | ||
135 | vim.schedule(function() | ||
136 | vim.keymap.set("n", "q", function() | ||
137 | vim.cmd("close") | ||
138 | pcall(vim.api.nvim_buf_delete, event.buf, { force = true }) | ||
139 | end, { | ||
140 | buffer = event.buf, | ||
141 | silent = true, | ||
142 | desc = "Quit buffer", | ||
143 | }) | ||
144 | end) | ||
145 | end, | ||
146 | }) | ||
147 | |||
148 | -- Auto create dir when saving a file, in case some intermediate directory does not exist | ||
149 | vim.api.nvim_create_autocmd({ "BufWritePre" }, { | ||
150 | group = augroup("auto_create_dir"), | ||
151 | callback = function(event) | ||
152 | if event.match:match("^%w%w+:[\\/][\\/]") then | ||
153 | return | ||
154 | end | ||
155 | local file = vim.uv.fs_realpath(event.match) or event.match | ||
156 | vim.fn.mkdir(vim.fn.fnamemodify(file, ":p:h"), "p") | ||
157 | end, | ||
158 | }) | ||
diff --git a/.config/nvim/lua/luasnippets/PKGBUILD.lua b/.config/nvim/lua/luasnippets/PKGBUILD.lua new file mode 100644 index 0000000..334baf1 --- /dev/null +++ b/.config/nvim/lua/luasnippets/PKGBUILD.lua | |||
@@ -0,0 +1,36 @@ | |||
1 | local ls = require("luasnip") | ||
2 | local s = ls.snippet | ||
3 | local sn = ls.snippet_node | ||
4 | local isn = ls.indent_snippet_node | ||
5 | local t = ls.text_node | ||
6 | local i = ls.insert_node | ||
7 | local f = ls.function_node | ||
8 | local c = ls.choice_node | ||
9 | local d = ls.dynamic_node | ||
10 | local r = ls.restore_node | ||
11 | local events = require("luasnip.util.events") | ||
12 | local ai = require("luasnip.nodes.absolute_indexer") | ||
13 | local extras = require("luasnip.extras") | ||
14 | local l = extras.lambda | ||
15 | local rep = extras.rep | ||
16 | local p = extras.partial | ||
17 | local m = extras.match | ||
18 | local n = extras.nonempty | ||
19 | local dl = extras.dynamic_lambda | ||
20 | local fmt = require("luasnip.extras.fmt").fmt | ||
21 | local fmta = require("luasnip.extras.fmt").fmta | ||
22 | local conds = require("luasnip.extras.expand_conditions") | ||
23 | local postfix = require("luasnip.extras.postfix").postfix | ||
24 | local types = require("luasnip.util.types") | ||
25 | local parse = require("luasnip.util.parser").parse_snippet | ||
26 | local ms = ls.multi_snippet | ||
27 | local k = require("luasnip.nodes.key_indexer").new_key | ||
28 | local strftime = vim.fn.strftime | ||
29 | |||
30 | return { | ||
31 | s("m", | ||
32 | { | ||
33 | t("# Maintainer: Yigit Sever <yigit at yigitsever dot com>") | ||
34 | } | ||
35 | ) | ||
36 | } | ||
diff --git a/.config/nvim/lua/luasnippets/mail.lua b/.config/nvim/lua/luasnippets/mail.lua new file mode 100644 index 0000000..3d60baa --- /dev/null +++ b/.config/nvim/lua/luasnippets/mail.lua | |||
@@ -0,0 +1,36 @@ | |||
1 | local ls = require("luasnip") | ||
2 | local s = ls.snippet | ||
3 | local sn = ls.snippet_node | ||
4 | local isn = ls.indent_snippet_node | ||
5 | local t = ls.text_node | ||
6 | local i = ls.insert_node | ||
7 | local f = ls.function_node | ||
8 | local c = ls.choice_node | ||
9 | local d = ls.dynamic_node | ||
10 | local r = ls.restore_node | ||
11 | local events = require("luasnip.util.events") | ||
12 | local ai = require("luasnip.nodes.absolute_indexer") | ||
13 | local extras = require("luasnip.extras") | ||
14 | local l = extras.lambda | ||
15 | local rep = extras.rep | ||
16 | local p = extras.partial | ||
17 | local m = extras.match | ||
18 | local n = extras.nonempty | ||
19 | local dl = extras.dynamic_lambda | ||
20 | local fmt = require("luasnip.extras.fmt").fmt | ||
21 | local fmta = require("luasnip.extras.fmt").fmta | ||
22 | local conds = require("luasnip.extras.expand_conditions") | ||
23 | local postfix = require("luasnip.extras.postfix").postfix | ||
24 | local types = require("luasnip.util.types") | ||
25 | local parse = require("luasnip.util.parser").parse_snippet | ||
26 | local ms = ls.multi_snippet | ||
27 | local k = require("luasnip.nodes.key_indexer").new_key | ||
28 | local strftime = vim.fn.strftime | ||
29 | |||
30 | return { | ||
31 | s("~", | ||
32 | { | ||
33 | t("~yigit") | ||
34 | } | ||
35 | ) | ||
36 | } | ||
diff --git a/.config/nvim/lua/luasnippets/vimwiki.lua b/.config/nvim/lua/luasnippets/vimwiki.lua new file mode 100644 index 0000000..c5e8532 --- /dev/null +++ b/.config/nvim/lua/luasnippets/vimwiki.lua | |||
@@ -0,0 +1,60 @@ | |||
1 | local ls = require("luasnip") | ||
2 | local s = ls.snippet | ||
3 | local sn = ls.snippet_node | ||
4 | local isn = ls.indent_snippet_node | ||
5 | local t = ls.text_node | ||
6 | local i = ls.insert_node | ||
7 | local f = ls.function_node | ||
8 | local c = ls.choice_node | ||
9 | local d = ls.dynamic_node | ||
10 | local r = ls.restore_node | ||
11 | local events = require("luasnip.util.events") | ||
12 | local ai = require("luasnip.nodes.absolute_indexer") | ||
13 | local extras = require("luasnip.extras") | ||
14 | local l = extras.lambda | ||
15 | local rep = extras.rep | ||
16 | local p = extras.partial | ||
17 | local m = extras.match | ||
18 | local n = extras.nonempty | ||
19 | local dl = extras.dynamic_lambda | ||
20 | local fmt = require("luasnip.extras.fmt").fmt | ||
21 | local fmta = require("luasnip.extras.fmt").fmta | ||
22 | local conds = require("luasnip.extras.expand_conditions") | ||
23 | local postfix = require("luasnip.extras.postfix").postfix | ||
24 | local types = require("luasnip.util.types") | ||
25 | local parse = require("luasnip.util.parser").parse_snippet | ||
26 | local ms = ls.multi_snippet | ||
27 | local k = require("luasnip.nodes.key_indexer").new_key | ||
28 | local strftime = vim.fn.strftime | ||
29 | |||
30 | local function clipboard() | ||
31 | local text = vim.fn.system({ 'wl-paste' }) | ||
32 | local output = string.gsub(text, "^%s*(.-)%s*$", "%1") | ||
33 | return output | ||
34 | end | ||
35 | |||
36 | return { | ||
37 | s("datasrc", | ||
38 | { | ||
39 | t({ "= " }), i(1), t({ " =", "" }), | ||
40 | t({ "", "== Used By ==", "" }), i(2), | ||
41 | t({ "", "== URL ==", "" }), i(3), | ||
42 | t({ "", "== API ==", "" }), i(4), | ||
43 | t({ "", "=== Example ===", "" }), i(5), | ||
44 | t({ "", "== Cost ==", "" }), i(6), | ||
45 | t({ "", "== Limits ==", "" }), i(0), | ||
46 | } | ||
47 | ), | ||
48 | s("s", | ||
49 | { | ||
50 | t({ "- (" }), | ||
51 | t({ strftime("%F %R") }), | ||
52 | t({ ") " }), | ||
53 | i(1, clipboard()), | ||
54 | t({ " -- " }), | ||
55 | i(2, "Summary") | ||
56 | |||
57 | } | ||
58 | ) | ||
59 | } | ||
60 | |||
diff --git a/.config/nvim/lua/plugins/cmp.lua b/.config/nvim/lua/plugins/cmp.lua index 2e8fade..097d413 100644 --- a/.config/nvim/lua/plugins/cmp.lua +++ b/.config/nvim/lua/plugins/cmp.lua | |||
@@ -3,14 +3,22 @@ return { | |||
3 | "hrsh7th/nvim-cmp", | 3 | "hrsh7th/nvim-cmp", |
4 | dependencies = { | 4 | dependencies = { |
5 | "hrsh7th/cmp-nvim-lsp", | 5 | "hrsh7th/cmp-nvim-lsp", |
6 | "hrsh7th/cmp-nvim-lsp-signature-help", | ||
6 | "hrsh7th/cmp-nvim-lua", | 7 | "hrsh7th/cmp-nvim-lua", |
7 | "hrsh7th/cmp-buffer", | 8 | "hrsh7th/cmp-buffer", |
8 | "hrsh7th/cmp-path", | 9 | "hrsh7th/cmp-path", |
9 | "hrsh7th/cmp-omni", | 10 | "hrsh7th/cmp-omni", |
10 | "hrsh7th/cmp-nvim-lsp-signature-help", | 11 | "micangl/cmp-vimtex", |
11 | "L3MON4D3/LuaSnip", | 12 | "L3MON4D3/LuaSnip", |
12 | "saadparwaiz1/cmp_luasnip", | 13 | "saadparwaiz1/cmp_luasnip", |
13 | }, | 14 | }, |
15 | opts = function(_, opts) | ||
16 | opts.sources = opts.sources or {} | ||
17 | table.insert(opts.sources, { | ||
18 | name = "lazydev", | ||
19 | group_index = 0, -- set group index to 0 to skip loading LuaLS completions | ||
20 | }) | ||
21 | end, | ||
14 | config = function() | 22 | config = function() |
15 | local cmp = require("cmp") | 23 | local cmp = require("cmp") |
16 | local luasnip = require("luasnip") | 24 | local luasnip = require("luasnip") |
@@ -45,15 +53,13 @@ return { | |||
45 | TypeParameter = "", | 53 | TypeParameter = "", |
46 | } | 54 | } |
47 | 55 | ||
48 | ---@diagnostic disable-next-line: missing-fields | ||
49 | cmp.setup({ | 56 | cmp.setup({ |
50 | enabled = function() | 57 | enabled = function() |
51 | -- disable autocompletion in telescope prompt | 58 | -- disable autocompletion in telescope prompt |
52 | local buftype = vim.api.nvim_buf_get_option(0, "buftype") | 59 | local buftype = vim.api.nvim_get_option_value("buftype", {}) |
53 | 60 | ||
54 | return buftype ~= "prompt" | 61 | return buftype ~= "prompt" |
55 | end, | 62 | end, |
56 | ---@diagnostic disable-next-line: missing-fields | ||
57 | completion = { | 63 | completion = { |
58 | completeopt = "menu,menuone,noselect", | 64 | completeopt = "menu,menuone,noselect", |
59 | }, | 65 | }, |
@@ -67,32 +73,25 @@ return { | |||
67 | end, | 73 | end, |
68 | }, | 74 | }, |
69 | mapping = cmp.mapping.preset.insert({ | 75 | mapping = cmp.mapping.preset.insert({ |
70 | ["<C-f>"] = cmp.mapping.scroll_docs(-4), | 76 | ["<C-l>"] = cmp.mapping.confirm({ |
71 | ["<C-d>"] = cmp.mapping.scroll_docs(4), | ||
72 | ["<CR>"] = cmp.mapping.confirm({ | ||
73 | behavior = cmp.ConfirmBehavior.Replace, | 77 | behavior = cmp.ConfirmBehavior.Replace, |
74 | select = false, | 78 | select = true, |
75 | }), | 79 | }), |
76 | ["<Tab>"] = cmp.mapping(function(fallback) | 80 | ["<Tab>"] = cmp.mapping(function(fallback) |
77 | if cmp.visible() then | 81 | if luasnip.locally_jumpable(1) then |
78 | cmp.select_next_item() | 82 | luasnip.jump(1) |
79 | elseif luasnip.expand_or_jumpable() then | ||
80 | luasnip.expand_or_jump() | ||
81 | else | 83 | else |
82 | fallback() | 84 | fallback() |
83 | end | 85 | end |
84 | end, { "i", "s" }), | 86 | end, { "i", "s" }), |
85 | ["<S-Tab>"] = cmp.mapping(function(fallback) | 87 | ["<S-Tab>"] = cmp.mapping(function(fallback) |
86 | if cmp.visible() then | 88 | if luasnip.locally_jumpable(-1) then |
87 | cmp.select_prev_item() | ||
88 | elseif luasnip.jumpable(-1) then | ||
89 | luasnip.jump(-1) | 89 | luasnip.jump(-1) |
90 | else | 90 | else |
91 | fallback() | 91 | fallback() |
92 | end | 92 | end |
93 | end, { "i", "s" }), | 93 | end, { "i", "s" }), |
94 | }), | 94 | }), |
95 | ---@diagnostic disable-next-line: missing-fields | ||
96 | formatting = { | 95 | formatting = { |
97 | fields = { "kind", "abbr", "menu" }, | 96 | fields = { "kind", "abbr", "menu" }, |
98 | format = function(entry, vim_item) | 97 | format = function(entry, vim_item) |
@@ -106,15 +105,18 @@ return { | |||
106 | buffer = "[ ]", | 105 | buffer = "[ ]", |
107 | path = "[ ]", | 106 | path = "[ ]", |
108 | })[entry.source.name] | 107 | })[entry.source.name] |
109 | return vim_item | 108 | -- return vim_item |
109 | return require("nvim-highlight-colors").format(entry, vim_item) | ||
110 | end, | 110 | end, |
111 | }, | 111 | }, |
112 | sources = { | 112 | sources = { |
113 | { name = "nvim_lsp" }, | 113 | { name = "nvim_lsp" }, |
114 | { name = "nvim_lsp_signature_help" }, | 114 | { name = "nvim_lua" }, |
115 | { name = "luasnip" }, | ||
116 | { name = "buffer" }, | 115 | { name = "buffer" }, |
117 | { name = "path" }, | 116 | { name = "path" }, |
117 | { name = "vimtex" }, | ||
118 | { name = "nvim_lsp_signature_help" }, | ||
119 | { name = "luasnip" }, | ||
118 | }, | 120 | }, |
119 | }) | 121 | }) |
120 | 122 | ||
@@ -126,7 +128,6 @@ return { | |||
126 | ) | 128 | ) |
127 | 129 | ||
128 | -- use omnifunc in vimwiki to complete paths and tags | 130 | -- use omnifunc in vimwiki to complete paths and tags |
129 | ---@diagnostic disable-next-line: missing-fields | ||
130 | cmp.setup.filetype('vimwiki', { | 131 | cmp.setup.filetype('vimwiki', { |
131 | sources = cmp.config.sources({ | 132 | sources = cmp.config.sources({ |
132 | { name = "omni" }, | 133 | { name = "omni" }, |
@@ -142,7 +143,7 @@ return { | |||
142 | }, | 143 | }, |
143 | { | 144 | { |
144 | 'mireq/luasnip-snippets', | 145 | 'mireq/luasnip-snippets', |
145 | dependencies = {'L3MON4D3/LuaSnip'}, | 146 | dependencies = { 'L3MON4D3/LuaSnip' }, |
146 | init = function() | 147 | init = function() |
147 | require('luasnip_snippets.common.snip_utils').setup() | 148 | require('luasnip_snippets.common.snip_utils').setup() |
148 | end | 149 | end |
@@ -166,15 +167,10 @@ return { | |||
166 | -- Required to automatically include base snippets, like "c" snippets for "cpp" | 167 | -- Required to automatically include base snippets, like "c" snippets for "cpp" |
167 | load_ft_func = require('luasnip_snippets.common.snip_utils').load_ft_func, | 168 | load_ft_func = require('luasnip_snippets.common.snip_utils').load_ft_func, |
168 | ft_func = require('luasnip_snippets.common.snip_utils').ft_func, | 169 | ft_func = require('luasnip_snippets.common.snip_utils').ft_func, |
169 | -- To enable auto expansin | 170 | -- To enable auto expansion |
170 | enable_autosnippets = true, | 171 | enable_autosnippets = true, |
171 | -- Uncomment to enable visual snippets triggered using <c-x> | ||
172 | -- store_selection_keys = '<c-x>', | ||
173 | }) | 172 | }) |
174 | -- LuaSnip key bindings | 173 | require("luasnip.loaders.from_lua").lazy_load({ paths = "./lua/luasnippets" }) |
175 | vim.keymap.set({"i", "s"}, "<C-l>", function() if ls.expand_or_jumpable() then ls.expand_or_jump() else vim.api.nvim_input('<C-l>') end end, {silent = true}) | ||
176 | vim.keymap.set({"i", "s"}, "<C-k>", function() ls.jump(-1) end, {silent = true}) | ||
177 | vim.keymap.set({"i", "s"}, "<C-E>", function() if ls.choice_active() then ls.change_choice(1) end end, {silent = true}) | ||
178 | end | 174 | end |
179 | 175 | ||
180 | }, | 176 | }, |
diff --git a/.config/nvim/lua/plugins/conform.lua b/.config/nvim/lua/plugins/conform.lua new file mode 100644 index 0000000..9f15bbb --- /dev/null +++ b/.config/nvim/lua/plugins/conform.lua | |||
@@ -0,0 +1,18 @@ | |||
1 | return { | ||
2 | { | ||
3 | 'stevearc/conform.nvim', | ||
4 | opts = { | ||
5 | formatters_by_ft = { | ||
6 | lua = { "stylua" }, | ||
7 | -- Conform will run multiple formatters sequentially | ||
8 | python = { "isort", "black" }, | ||
9 | -- You can customize some of the format options for the filetype (:help conform.format) | ||
10 | rust = { "rustfmt", lsp_format = "fallback" }, | ||
11 | -- Conform will run the first available formatter | ||
12 | javascript = { "prettierd", "prettier", stop_after_first = true }, | ||
13 | -- latex | ||
14 | tex = { "tex-fmt" }, | ||
15 | }, | ||
16 | } | ||
17 | }, | ||
18 | } | ||
diff --git a/.config/nvim/lua/plugins/cutlass.lua b/.config/nvim/lua/plugins/cutlass.lua index b9332a9..c3cabe4 100644 --- a/.config/nvim/lua/plugins/cutlass.lua +++ b/.config/nvim/lua/plugins/cutlass.lua | |||
@@ -32,19 +32,39 @@ return { | |||
32 | { | 32 | { |
33 | "gbprod/yanky.nvim", | 33 | "gbprod/yanky.nvim", |
34 | config = function() | 34 | config = function() |
35 | -- fix Target STRING not available | 35 | if os.getenv("WAYLAND_DISPLAY") then |
36 | vim.g.clipboard = { | 36 | vim.g.clipboard = { |
37 | name = 'xsel_override', | 37 | name = "wl-clipboard", |
38 | copy = { | 38 | copy = { |
39 | ['+'] = 'xsel --input --clipboard', | 39 | ["+"] = 'wl-copy --foreground --type text/plain', |
40 | ['*'] = 'xsel --input --primary', | 40 | ["*"] = 'wl-copy --foreground --primary --type text/plain', |
41 | }, | 41 | }, |
42 | paste = { | 42 | paste = { |
43 | ['+'] = 'xsel --output --clipboard', | 43 | ["+"] = (function() |
44 | ['*'] = 'xsel --output --primary', | 44 | return vim.fn.systemlist('wl-paste --no-newline', { '' }, 1) -- '1' keeps empty lines |
45 | }, | 45 | end), |
46 | cache_enabled = 1, | 46 | ["*"] = (function() |
47 | } | 47 | return vim.fn.systemlist('wl-paste --primary --no-newline', { '' }, 1) |
48 | end), | ||
49 | }, | ||
50 | cache_enabled = true | ||
51 | } | ||
52 | else | ||
53 | -- fix Target STRING not available | ||
54 | -- if we are using xsel (X11) | ||
55 | vim.g.clipboard = { | ||
56 | name = 'xsel_override', | ||
57 | copy = { | ||
58 | ['+'] = 'xsel --input --clipboard', | ||
59 | ['*'] = 'xsel --input --primary', | ||
60 | }, | ||
61 | paste = { | ||
62 | ['+'] = 'xsel --output --clipboard', | ||
63 | ['*'] = 'xsel --output --primary', | ||
64 | }, | ||
65 | cache_enabled = 1, | ||
66 | } | ||
67 | end | ||
48 | 68 | ||
49 | local map = require("helpers.keys").map | 69 | local map = require("helpers.keys").map |
50 | 70 | ||
diff --git a/.config/nvim/lua/plugins/git.lua b/.config/nvim/lua/plugins/git.lua index 0e4d7f5..5f1c1e3 100644 --- a/.config/nvim/lua/plugins/git.lua +++ b/.config/nvim/lua/plugins/git.lua | |||
@@ -1,15 +1,27 @@ | |||
1 | return { | 1 | return { |
2 | { | 2 | { |
3 | "purarue/gitsigns-yadm.nvim", | ||
4 | lazy = true, | ||
5 | }, | ||
6 | { | ||
3 | "lewis6991/gitsigns.nvim", | 7 | "lewis6991/gitsigns.nvim", |
8 | event = { "BufReadPost", "VeryLazy" }, | ||
4 | opts = { | 9 | opts = { |
5 | signs = { | 10 | signs = { |
6 | add = { text = '│' }, | 11 | add = { text = '│' }, |
7 | change = { text = '│' }, | 12 | change = { text = '~' }, |
8 | delete = { text = '_' }, | 13 | delete = { text = '_' }, |
9 | topdelete = { text = '‾' }, | 14 | topdelete = { text = '‾' }, |
10 | changedelete = { text = '~' }, | 15 | changedelete = { text = '~' }, |
11 | untracked = { text = '┆' }, | 16 | untracked = { text = '┆' }, |
12 | }, | 17 | }, |
18 | _on_attach_pre = function(_, callback) | ||
19 | if vim.fn.executable("yadm") == 1 then | ||
20 | require("gitsigns-yadm").yadm_signs(callback) | ||
21 | else | ||
22 | callback() | ||
23 | end | ||
24 | end, | ||
13 | signcolumn = true, -- Toggle with `:Gitsigns toggle_signs` | 25 | signcolumn = true, -- Toggle with `:Gitsigns toggle_signs` |
14 | numhl = false, -- Toggle with `:Gitsigns toggle_numhl` | 26 | numhl = false, -- Toggle with `:Gitsigns toggle_numhl` |
15 | linehl = false, -- Toggle with `:Gitsigns toggle_linehl` | 27 | linehl = false, -- Toggle with `:Gitsigns toggle_linehl` |
@@ -38,10 +50,6 @@ return { | |||
38 | row = 0, | 50 | row = 0, |
39 | col = 1 | 51 | col = 1 |
40 | }, | 52 | }, |
41 | yadm = { | ||
42 | enable = true | ||
43 | }, | ||
44 | |||
45 | on_attach = function(bufnr) | 53 | on_attach = function(bufnr) |
46 | local gs = package.loaded.gitsigns | 54 | local gs = package.loaded.gitsigns |
47 | 55 | ||
@@ -89,7 +97,13 @@ return { | |||
89 | }, | 97 | }, |
90 | }, | 98 | }, |
91 | { | 99 | { |
92 | "tpope/vim-fugitive", | 100 | "NeogitOrg/neogit", |
93 | cmd = { 'Git', 'Gstatus', 'Gblame', 'Gpush', 'Gpull' }, | 101 | dependencies = { |
94 | }, | 102 | "nvim-lua/plenary.nvim", -- required |
103 | "sindrets/diffview.nvim", -- optional - Diff integration | ||
104 | "nvim-telescope/telescope.nvim", -- optional | ||
105 | }, | ||
106 | cmd = "Neogit", | ||
107 | config = true | ||
108 | } | ||
95 | } | 109 | } |
diff --git a/.config/nvim/lua/plugins/lastplace.lua b/.config/nvim/lua/plugins/lastplace.lua new file mode 100644 index 0000000..72e5c7f --- /dev/null +++ b/.config/nvim/lua/plugins/lastplace.lua | |||
@@ -0,0 +1,11 @@ | |||
1 | return { | ||
2 | { | ||
3 | "ethanholz/nvim-lastplace", | ||
4 | |||
5 | opts = { | ||
6 | lastplace_ignore_buftype = { "quickfix", "nofile", "help" }, | ||
7 | lastplace_ignore_filetype = { "gitcommit", "gitrebase", "svn", "hgcommit" }, | ||
8 | lastplace_open_folds = true, | ||
9 | }, | ||
10 | } | ||
11 | } | ||
diff --git a/.config/nvim/lua/plugins/lsp.lua b/.config/nvim/lua/plugins/lsp.lua index 029a0f1..e710fd7 100644 --- a/.config/nvim/lua/plugins/lsp.lua +++ b/.config/nvim/lua/plugins/lsp.lua | |||
@@ -1,9 +1,10 @@ | |||
1 | return { | 1 | return { |
2 | { | 2 | { |
3 | "neovim/nvim-lspconfig", | 3 | "neovim/nvim-lspconfig", |
4 | event = { "BufReadPost", "BufNewFile" }, | ||
5 | cmd = { "LspInfo", "LspInstall", "LspUninstall" }, | ||
4 | dependencies = { | 6 | dependencies = { |
5 | "j-hui/fidget.nvim", | 7 | "j-hui/fidget.nvim", |
6 | "folke/neodev.nvim", | ||
7 | "RRethy/vim-illuminate", | 8 | "RRethy/vim-illuminate", |
8 | "hrsh7th/cmp-nvim-lsp", | 9 | "hrsh7th/cmp-nvim-lsp", |
9 | }, | 10 | }, |
@@ -14,9 +15,6 @@ return { | |||
14 | map('n', '[d', vim.diagnostic.goto_prev, "lsp: goto previous diagnostic") | 15 | map('n', '[d', vim.diagnostic.goto_prev, "lsp: goto previous diagnostic") |
15 | map('n', ']d', vim.diagnostic.goto_next, "lsp: goto next diagnostic") | 16 | map('n', ']d', vim.diagnostic.goto_next, "lsp: goto next diagnostic") |
16 | 17 | ||
17 | -- neodev setup before lsp config | ||
18 | require("neodev").setup() | ||
19 | |||
20 | -- set up cool signs for diagnostics | 18 | -- set up cool signs for diagnostics |
21 | local signs = { Error = " ", Warn = "", Hint = "", Info = "" } | 19 | local signs = { Error = " ", Warn = "", Hint = "", Info = "" } |
22 | for type, icon in pairs(signs) do | 20 | for type, icon in pairs(signs) do |
@@ -72,6 +70,29 @@ return { | |||
72 | local capabilities = vim.lsp.protocol.make_client_capabilities() | 70 | local capabilities = vim.lsp.protocol.make_client_capabilities() |
73 | capabilities = require("cmp_nvim_lsp").default_capabilities(capabilities) | 71 | capabilities = require("cmp_nvim_lsp").default_capabilities(capabilities) |
74 | 72 | ||
73 | -- misc. | ||
74 | local lspconfig = require('lspconfig') | ||
75 | local servers = { 'ts_ls', 'jsonls', 'eslint', 'cssls', 'html', 'vala_ls', 'gopls' } | ||
76 | for _, lsp in pairs(servers) do | ||
77 | lspconfig[lsp].setup { | ||
78 | on_attach = on_attach, | ||
79 | capabilites = capabilities, | ||
80 | } | ||
81 | end | ||
82 | |||
83 | -- typst/tinymist | ||
84 | require("lspconfig")["tinymist"].setup({ | ||
85 | on_attach = on_attach, | ||
86 | capabilities = capabilities, | ||
87 | single_file_support = true, | ||
88 | root_dir = function() | ||
89 | return vim.fn.getcwd() | ||
90 | end, | ||
91 | settings = { | ||
92 | formatterMode = "typstyle", | ||
93 | } | ||
94 | }) | ||
95 | |||
75 | -- lua | 96 | -- lua |
76 | require("lspconfig")["lua_ls"].setup({ | 97 | require("lspconfig")["lua_ls"].setup({ |
77 | on_attach = on_attach, | 98 | on_attach = on_attach, |
@@ -120,10 +141,52 @@ return { | |||
120 | -- efm | 141 | -- efm |
121 | require("lspconfig")["efm"].setup({ | 142 | require("lspconfig")["efm"].setup({ |
122 | on_attach = on_attach, | 143 | on_attach = on_attach, |
123 | filetypes = { 'sh' }, | 144 | settings = { |
124 | capabilities = capabilities | 145 | initializationOptions = { |
146 | documentFormatting = true, | ||
147 | documentRangeFormatting = true, | ||
148 | hover = true, | ||
149 | documentSymbol = true, | ||
150 | codeAction = true, | ||
151 | completion = true | ||
152 | } | ||
153 | }, | ||
154 | capabilities = capabilities, | ||
155 | filetypes = { 'sh', 'tex' }, | ||
125 | }) | 156 | }) |
126 | 157 | ||
158 | require("lspconfig")["harper_ls"].setup { | ||
159 | on_attach = on_attach, | ||
160 | capabilities = capabilities, | ||
161 | settings = { | ||
162 | ["harper-ls"] = { | ||
163 | linters = { | ||
164 | spell_check = true, | ||
165 | spelled_numbers = false, | ||
166 | an_a = true, | ||
167 | sentence_capitalization = true, | ||
168 | unclosed_quotes = true, | ||
169 | wrong_quotes = false, | ||
170 | long_sentences = true, | ||
171 | repeated_words = true, | ||
172 | spaces = true, | ||
173 | matcher = true, | ||
174 | correct_number_suffix = true, | ||
175 | number_suffix_capitalization = true, | ||
176 | multiple_sequential_pronouns = true, | ||
177 | linking_verbs = false, | ||
178 | avoid_curses = true, | ||
179 | } | ||
180 | } | ||
181 | }, | ||
182 | filetypes = { | ||
183 | "markdown", "rust", "typescript", "typescriptreact", "javascript", "python", "c", "cpp", "ruby", "swift", "csharp", "toml", "lua", "gitcommit", "java", "html", "vimwiki", "tex" | ||
184 | }, | ||
185 | root_dir = function(fname) | ||
186 | return vim.fs.dirname(vim.fs.find('.git', { path = fname, upward = true })[1]) | ||
187 | end, | ||
188 | } | ||
189 | |||
127 | -- ltex | 190 | -- ltex |
128 | require("lspconfig")["ltex"].setup({ | 191 | require("lspconfig")["ltex"].setup({ |
129 | capabilities = capabilities, | 192 | capabilities = capabilities, |
@@ -135,51 +198,38 @@ return { | |||
135 | log_level = "none", | 198 | log_level = "none", |
136 | } | 199 | } |
137 | end, | 200 | end, |
201 | filetypes = { "bib", "gitcommit", "markdown", "org", "plaintex", "rst", "rnoweb", "tex", "pandoc", "quarto", "rmd", "context", "mail", "text" }, | ||
138 | settings = { | 202 | settings = { |
139 | ltex = { | 203 | ltex = { |
140 | -- my settings here | 204 | enabled = { "bibtex", "gitcommit", "markdown", "org", "tex", "restructuredtext", "rsweave", "latex", "quarto", "rmd", "context", "mail", "plaintext" } |
141 | } | 205 | } |
142 | } | 206 | } |
143 | }) | 207 | }) |
144 | 208 | ||
145 | -- rust-tools | 209 | vim.g.rustaceanvim = { |
146 | local rust_opts = { | 210 | -- Plugin configuration |
147 | tools = { | 211 | tools = { |
148 | runnables = { | ||
149 | use_telescope = true, | ||
150 | }, | ||
151 | inlay_hints = { | ||
152 | auto = true, | ||
153 | show_parameter_hints = true, | ||
154 | parameter_hints_prefix = "↸ ", | ||
155 | other_hints_prefix = "❱ ", | ||
156 | }, | ||
157 | }, | 212 | }, |
158 | 213 | -- LSP configuration | |
159 | -- all the opts to send to nvim-lspconfig | ||
160 | -- these override the defaults set by rust-tools.nvim | ||
161 | -- see https://github.com/neovim/nvim-lspconfig/blob/master/CONFIG.md#rust_analyzer | ||
162 | server = { | 214 | server = { |
163 | on_attach = on_attach, | 215 | on_attach = on_attach, |
164 | settings = { | 216 | vim.lsp.inlay_hint.enable(true), |
165 | -- to enable rust-analyzer settings visit: | 217 | default_settings = { |
166 | -- https://github.com/rust-analyzer/rust-analyzer/blob/master/docs/user/generated_config.adoc | 218 | -- rust-analyzer language server configuration |
167 | ["rust-analyzer"] = { | 219 | ['rust-analyzer'] = { |
168 | -- enable clippy on save | ||
169 | checkOnSave = { | ||
170 | command = "clippy", | ||
171 | }, | ||
172 | }, | 220 | }, |
173 | }, | 221 | }, |
174 | }, | 222 | }, |
223 | -- DAP configuration | ||
224 | dap = { | ||
225 | }, | ||
175 | } | 226 | } |
176 | |||
177 | require('rust-tools').setup(rust_opts) | ||
178 | end, | 227 | end, |
179 | }, | 228 | }, |
180 | { | 229 | { |
181 | "barreiroleo/ltex-extra.nvim", | 230 | "barreiroleo/ltex_extra.nvim", |
182 | event = "LspAttach", | 231 | ft = { "markdown", "tex" }, |
232 | dependencies = { "neovim/nvim-lspconfig" }, | ||
183 | }, | 233 | }, |
184 | { | 234 | { |
185 | "j-hui/fidget.nvim", | 235 | "j-hui/fidget.nvim", |
@@ -199,7 +249,38 @@ return { | |||
199 | }, | 249 | }, |
200 | }, | 250 | }, |
201 | { | 251 | { |
202 | "simrat39/rust-tools.nvim", | 252 | 'mrcjkb/rustaceanvim', |
203 | event = "LspAttach", | 253 | version = '^5', -- Recommended |
254 | lazy = false, -- This plugin is already lazy | ||
255 | }, | ||
256 | { | ||
257 | "folke/lazydev.nvim", | ||
258 | ft = "lua", | ||
259 | }, | ||
260 | { | ||
261 | 'fatih/vim-go' | ||
204 | }, | 262 | }, |
263 | { | ||
264 | "danymat/neogen", | ||
265 | config = true, | ||
266 | opts = { | ||
267 | snippet_engine = "luasnip", | ||
268 | languages = { | ||
269 | python = { | ||
270 | template = { | ||
271 | annotation_convention = "reST", | ||
272 | } | ||
273 | } | ||
274 | } | ||
275 | } | ||
276 | }, | ||
277 | { | ||
278 | 'marcelofern/vale.nvim', | ||
279 | config = function() | ||
280 | require("vale").setup({ | ||
281 | bin = "/usr/bin/vale", | ||
282 | vale_config_path = "$HOME/.config/vale/.vale.ini", | ||
283 | }) | ||
284 | end, | ||
285 | } | ||
205 | } | 286 | } |
diff --git a/.config/nvim/lua/plugins/lualine.lua b/.config/nvim/lua/plugins/lualine.lua index c4e936e..ba1099e 100644 --- a/.config/nvim/lua/plugins/lualine.lua +++ b/.config/nvim/lua/plugins/lualine.lua | |||
@@ -30,6 +30,7 @@ end | |||
30 | 30 | ||
31 | return { | 31 | return { |
32 | "nvim-lualine/lualine.nvim", | 32 | "nvim-lualine/lualine.nvim", |
33 | event = "VeryLazy", | ||
33 | dependencies = { | 34 | dependencies = { |
34 | "nvim-tree/nvim-web-devicons" | 35 | "nvim-tree/nvim-web-devicons" |
35 | }, | 36 | }, |
diff --git a/.config/nvim/lua/plugins/misc.lua b/.config/nvim/lua/plugins/misc.lua index f99051e..fc28ffa 100644 --- a/.config/nvim/lua/plugins/misc.lua +++ b/.config/nvim/lua/plugins/misc.lua | |||
@@ -80,4 +80,11 @@ return { | |||
80 | npairs.add_rule(Rule('%"', '%"', "remind")) | 80 | npairs.add_rule(Rule('%"', '%"', "remind")) |
81 | end | 81 | end |
82 | }, | 82 | }, |
83 | { | ||
84 | "brenoprata10/nvim-highlight-colors", | ||
85 | event = { "BufReadPost", "VeryLazy" }, | ||
86 | config = function() | ||
87 | require('nvim-highlight-colors').setup({}) | ||
88 | end | ||
89 | } | ||
83 | } | 90 | } |
diff --git a/.config/nvim/lua/plugins/nvim-tree.lua b/.config/nvim/lua/plugins/nvim-tree.lua index a2d4532..667a873 100644 --- a/.config/nvim/lua/plugins/nvim-tree.lua +++ b/.config/nvim/lua/plugins/nvim-tree.lua | |||
@@ -1,14 +1,15 @@ | |||
1 | return { | 1 | return { |
2 | { | 2 | { |
3 | "nvim-tree/nvim-tree.lua", | 3 | "nvim-tree/nvim-tree.lua", |
4 | lazy = false, | ||
5 | dependencies = { | 4 | dependencies = { |
6 | "nvim-tree/nvim-web-devicons", | 5 | "nvim-tree/nvim-web-devicons", |
7 | }, | 6 | }, |
8 | opts = { | 7 | opts = { |
9 | sort_by = "case_sensitive", | 8 | sort = { |
9 | sorter = "case_sensitive" | ||
10 | }, | ||
10 | diagnostics = { | 11 | diagnostics = { |
11 | enable = false, | 12 | enable = true, |
12 | icons = { | 13 | icons = { |
13 | hint = "❔", | 14 | hint = "❔", |
14 | info = "❕", | 15 | info = "❕", |
@@ -16,9 +17,6 @@ return { | |||
16 | error = "❌", | 17 | error = "❌", |
17 | } | 18 | } |
18 | }, | 19 | }, |
19 | view = { | ||
20 | adaptive_size = true, | ||
21 | }, | ||
22 | renderer = { | 20 | renderer = { |
23 | group_empty = true, | 21 | group_empty = true, |
24 | }, | 22 | }, |
@@ -34,7 +32,7 @@ return { | |||
34 | 32 | ||
35 | map("n", "vt", "<cmd>NvimTreeToggle<cr>") | 33 | map("n", "vt", "<cmd>NvimTreeToggle<cr>") |
36 | map("n", "vr", "<cmd>NvimTreeRefresh<cr>") | 34 | map("n", "vr", "<cmd>NvimTreeRefresh<cr>") |
37 | map("n", "vs", "<cmd>NvimTreeFindFile<cr>") | 35 | map("n", "vs", "<cmd>NvimTreeFindFile!<cr>") |
38 | end, | 36 | end, |
39 | }, | 37 | }, |
40 | } | 38 | } |
diff --git a/.config/nvim/lua/plugins/telescope.lua b/.config/nvim/lua/plugins/telescope.lua index 6acc9a6..bfda4aa 100644 --- a/.config/nvim/lua/plugins/telescope.lua +++ b/.config/nvim/lua/plugins/telescope.lua | |||
@@ -11,7 +11,6 @@ return { | |||
11 | }, | 11 | }, |
12 | "gbprod/yanky.nvim", | 12 | "gbprod/yanky.nvim", |
13 | }, | 13 | }, |
14 | lazy = false, | ||
15 | config = function() | 14 | config = function() |
16 | require('telescope').setup({ | 15 | require('telescope').setup({ |
17 | defaults = { | 16 | defaults = { |
@@ -47,6 +46,10 @@ return { | |||
47 | map("n", "<leader>sw", require("telescope.builtin").grep_string, "🔭: current word") | 46 | map("n", "<leader>sw", require("telescope.builtin").grep_string, "🔭: current word") |
48 | map("n", "<leader>sg", require("telescope.builtin").live_grep, "🔭: live grep") | 47 | map("n", "<leader>sg", require("telescope.builtin").live_grep, "🔭: live grep") |
49 | map("n", "<leader>sd", require("telescope.builtin").diagnostics, "🔭: diagnostics") | 48 | map("n", "<leader>sd", require("telescope.builtin").diagnostics, "🔭: diagnostics") |
49 | map("n", "<leader>sc", function() | ||
50 | require("telescope.builtin").lsp_document_symbols({ symbols = 'function' }) | ||
51 | end, "🔭: lsp symbols (functions)") | ||
52 | |||
50 | map("n", "<leader>st", function() | 53 | map("n", "<leader>st", function() |
51 | require("telescope.builtin").spell_suggest(require("telescope.themes").get_cursor({ | 54 | require("telescope.builtin").spell_suggest(require("telescope.themes").get_cursor({ |
52 | prompt_title = "", | 55 | prompt_title = "", |
diff --git a/.config/nvim/lua/plugins/trouble.lua b/.config/nvim/lua/plugins/trouble.lua index b80aed3..c11778c 100644 --- a/.config/nvim/lua/plugins/trouble.lua +++ b/.config/nvim/lua/plugins/trouble.lua | |||
@@ -1,16 +1,37 @@ | |||
1 | return { | 1 | return { |
2 | "folke/trouble.nvim", | 2 | "folke/trouble.nvim", |
3 | dependencies = { "nvim-tree/nvim-web-devicons" }, | 3 | cmd = "Trouble", |
4 | opts = {}, | 4 | opts = {}, |
5 | config = function() | 5 | keys = { |
6 | local map = require("helpers.keys").map | 6 | { |
7 | map("n", "<leader>xx", function() require("trouble").open() end, "trouble: open") | 7 | "<leader>xx", |
8 | map("n", "<leader>xw", function() require("trouble").open("workspace_diagnostics") end, | 8 | "<cmd>Trouble diagnostics toggle<cr>", |
9 | "trouble: open workspace diagnostics") | 9 | desc = "Diagnostics (Trouble)", |
10 | map("n", "<leader>xd", function() require("trouble").open("document_diagnostics") end, | 10 | }, |
11 | "trouble: open document diagnostics") | 11 | { |
12 | map("n", "<leader>xq", function() require("trouble").open("quickfix") end, "trouble: open quickfix") | 12 | "<leader>xX", |
13 | map("n", "<leader>xl", function() require("trouble").open("loclist") end, "trouble: open loclist") | 13 | "<cmd>Trouble diagnostics toggle filter.buf=0<cr>", |
14 | map("n", "gR", function() require("trouble").open("lsp_references") end, "trouble: open lsp references") | 14 | desc = "Buffer Diagnostics (Trouble)", |
15 | end, | 15 | }, |
16 | { | ||
17 | "<leader>cs", | ||
18 | "<cmd>Trouble symbols toggle focus=false<cr>", | ||
19 | desc = "Symbols (Trouble)", | ||
20 | }, | ||
21 | { | ||
22 | "<leader>cl", | ||
23 | "<cmd>Trouble lsp toggle focus=false win.position=right<cr>", | ||
24 | desc = "LSP Definitions / references / ... (Trouble)", | ||
25 | }, | ||
26 | { | ||
27 | "<leader>xL", | ||
28 | "<cmd>Trouble loclist toggle<cr>", | ||
29 | desc = "Location List (Trouble)", | ||
30 | }, | ||
31 | { | ||
32 | "<leader>xQ", | ||
33 | "<cmd>Trouble qflist toggle<cr>", | ||
34 | desc = "Quickfix List (Trouble)", | ||
35 | }, | ||
36 | }, | ||
16 | } | 37 | } |
diff --git a/.config/nvim/lua/plugins/typst.lua b/.config/nvim/lua/plugins/typst.lua new file mode 100644 index 0000000..c04ea70 --- /dev/null +++ b/.config/nvim/lua/plugins/typst.lua | |||
@@ -0,0 +1,10 @@ | |||
1 | return { | ||
2 | { | ||
3 | 'chomosuke/typst-preview.nvim', | ||
4 | ft = 'typst', | ||
5 | version = '1.*', | ||
6 | config = function() | ||
7 | require 'typst-preview'.setup {} | ||
8 | end, | ||
9 | } | ||
10 | } | ||
diff --git a/.config/nvim/lua/plugins/vimwiki.lua b/.config/nvim/lua/plugins/vimwiki.lua index a114b04..75d69cf 100644 --- a/.config/nvim/lua/plugins/vimwiki.lua +++ b/.config/nvim/lua/plugins/vimwiki.lua | |||
@@ -1,6 +1,6 @@ | |||
1 | return { | 1 | return { |
2 | { | 2 | { |
3 | "yigitsever/vimwiki", | 3 | "vimwiki/vimwiki", |
4 | init = function() | 4 | init = function() |
5 | vim.g.vimwiki_list = { | 5 | vim.g.vimwiki_list = { |
6 | { | 6 | { |
@@ -17,13 +17,12 @@ return { | |||
17 | } | 17 | } |
18 | vim.g.vimwiki_global_ext = 0 | 18 | vim.g.vimwiki_global_ext = 0 |
19 | vim.g.vimwiki_hl_headers = 1 | 19 | vim.g.vimwiki_hl_headers = 1 |
20 | |||
21 | local map = require("helpers.keys").map | ||
22 | |||
23 | --toggle checkmarks | ||
24 | map('n', '<leader>v', '<Plug>VimwikiToggleListItem', "vimwiki: toggle checkmark") | ||
25 | -- add/increase header level | ||
26 | map('n', '<leader>a', '<Plug>VimwikiAddHeaderLevel', "vimwiki: add header level") | ||
27 | end, | 20 | end, |
21 | keys = { | ||
22 | { "<leader>ww", "<Plug>VimwikiIndex", "vimwiki: goto wiki" }, | ||
23 | { "<leader>v", "<Plug>VimwikiToggleListItem", "vimwiki: toggle list item" }, | ||
24 | { "<leader>a", "<Plug>VimwikiAddHeaderLevel", "vimwiki: add header level" } | ||
25 | }, | ||
26 | ft = { "vimwiki" } | ||
28 | }, | 27 | }, |
29 | } | 28 | } |
diff --git a/.config/nvim/spell/en.utf-8.add b/.config/nvim/spell/en.utf-8.add index 3a1e37b..8374b5b 100644 --- a/.config/nvim/spell/en.utf-8.add +++ b/.config/nvim/spell/en.utf-8.add | |||
@@ -61,3 +61,71 @@ microcontroller | |||
61 | kubernetes | 61 | kubernetes |
62 | Kubernetes | 62 | Kubernetes |
63 | microdata | 63 | microdata |
64 | Tranco | ||
65 | CNAME | ||
66 | MX | ||
67 | NS | ||
68 | Alexa | ||
69 | AXFR | ||
70 | CTLs | ||
71 | PSL | ||
72 | subbrute | ||
73 | dnsrecon | ||
74 | CTL | ||
75 | FQDN | ||
76 | massdns | ||
77 | FQDNs | ||
78 | USENIX | ||
79 | AQUATONE | ||
80 | Sublist3r | ||
81 | Dorking | ||
82 | DNSDumpster | ||
83 | CyberSA | ||
84 | RNN | ||
85 | Degani | ||
86 | Recon | ||
87 | ICONAT | ||
88 | subfinder | ||
89 | ICICIS | ||
90 | crt | ||
91 | puredns | ||
92 | TakeOver | ||
93 | th | ||
94 | ICCIT | ||
95 | censys | ||
96 | NSDI | ||
97 | st | ||
98 | PDNS | ||
99 | Rapid7 | ||
100 | Zhang | ||
101 | AAAA | ||
102 | yigit | ||
103 | GAN | ||
104 | SIGAPP | ||
105 | altdns | ||
106 | com | ||
107 | bugcrowd | ||
108 | SecLists | ||
109 | IOP | ||
110 | Sudomy | ||
111 | OneForAll | ||
112 | HackerTarget | ||
113 | Spyse | ||
114 | GraphTunnel | ||
115 | Cloudflare | ||
116 | NSEC5 | ||
117 | S3 | ||
118 | a4paper | ||
119 | letterpaper | ||
120 | bibtex | ||
121 | SIGSAC | ||
122 | ICOEI | ||
123 | Gelernter | ||
124 | Global500 | ||
125 | Defenses | ||
126 | Analyzing | ||
127 | analyze | ||
128 | Wayback | ||
129 | FarSight | ||
130 | Zetalytics | ||
131 | VirusTotal | ||
diff --git a/.config/picom/picom.conf##h.luchs b/.config/picom/picom.conf##h.luchs deleted file mode 100644 index 4cc1846..0000000 --- a/.config/picom/picom.conf##h.luchs +++ /dev/null | |||
@@ -1,69 +0,0 @@ | |||
1 | # log | ||
2 | log-level = "warn"; | ||
3 | log-file = "/home/yigit/.local/share/picom/picom.log"; | ||
4 | |||
5 | # shadow | ||
6 | shadow = true; | ||
7 | shadow-radius = 0; | ||
8 | shadow-offset-x = 5; | ||
9 | shadow-offset-y = 5; | ||
10 | shadow-opacity = 0.8; | ||
11 | |||
12 | shadow-exclude = [ | ||
13 | "name = 'Notification'", | ||
14 | "class_g = 'Conky'", | ||
15 | "class_g = 'Dunst'", | ||
16 | "_GTK_FRAME_EXTENTS@:c" | ||
17 | ]; | ||
18 | |||
19 | # opacity | ||
20 | inactive-opacity = 1; | ||
21 | # active-opacity = 0.8; | ||
22 | frame-opacity = 1.0; | ||
23 | inactive-opacity-override = false; | ||
24 | inactive-dim = 0.0; | ||
25 | |||
26 | opacity-rule = [ | ||
27 | "100:_NET_WM_STATE@[0]:32a = '_NET_WM_STATE_FULLSCREEN'", | ||
28 | "100:_NET_WM_STATE@[1]:32a = '_NET_WM_STATE_FULLSCREEN'", | ||
29 | "100:_NET_WM_STATE@[2]:32a = '_NET_WM_STATE_FULLSCREEN'", | ||
30 | "100:_NET_WM_STATE@[3]:32a = '_NET_WM_STATE_FULLSCREEN'", | ||
31 | "100:_NET_WM_STATE@[4]:32a = '_NET_WM_STATE_FULLSCREEN'", | ||
32 | "0:_NET_WM_STATE@:32a *= '_NET_WM_STATE_HIDDEN'" | ||
33 | ]; | ||
34 | |||
35 | # fading | ||
36 | fading = true; | ||
37 | fade-in-step = 0.03; | ||
38 | fade-out-step = 0.03; | ||
39 | fade-exclude = [ ]; | ||
40 | |||
41 | # other | ||
42 | backend = "glx"; | ||
43 | mark-wmwin-focused = true; | ||
44 | mark-ovredir-focused = true; | ||
45 | detect-rounded-corners = true; | ||
46 | detect-client-opacity = true; | ||
47 | refresh-rate = 0; | ||
48 | vsync = true; | ||
49 | sw-opti = false; | ||
50 | unredir-if-possible = false; | ||
51 | detect-transient = true; | ||
52 | detect-client-leader = true; | ||
53 | invert-color-include = [ ]; | ||
54 | |||
55 | # glx backend | ||
56 | glx-no-stencil = true; | ||
57 | glx-copy-from-front = false; | ||
58 | use-damage = true | ||
59 | xrender-sync-fence = true; | ||
60 | |||
61 | # window type settings | ||
62 | wintypes: | ||
63 | { | ||
64 | tooltip = { fade = true; shadow = true; opacity = 0.75; focus = true; full-shadow = false; }; | ||
65 | dock = { shadow = false; } | ||
66 | dnd = { shadow = false; } | ||
67 | popup_menu = { fade = true; shadow = true; opacity = 1; focus = true; full-shadow = true; } | ||
68 | dropdown_menu = { opacity = 1; } | ||
69 | }; | ||
diff --git a/.config/polybar/config.ini##h.luchs b/.config/polybar/config.ini##h.luchs deleted file mode 100644 index c7fc4af..0000000 --- a/.config/polybar/config.ini##h.luchs +++ /dev/null | |||
@@ -1,293 +0,0 @@ | |||
1 | ;========================================================== | ||
2 | ; | ||
3 | ; ██████╗ ██████╗ ██╗ ██╗ ██╗██████╗ █████╗ ██████╗ | ||
4 | ; ██╔══██╗██╔═══██╗██║ ╚██╗ ██╔╝██╔══██╗██╔══██╗██╔══██╗ | ||
5 | ; ██████╔╝██║ ██║██║ ╚████╔╝ ██████╔╝███████║██████╔╝ | ||
6 | ; ██╔═══╝ ██║ ██║██║ ╚██╔╝ ██╔══██╗██╔══██║██╔══██╗ | ||
7 | ; ██║ ╚██████╔╝███████╗██║ ██████╔╝██║ ██║██║ ██║ | ||
8 | ; ╚═╝ ╚═════╝ ╚══════╝╚═╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝ | ||
9 | ; | ||
10 | ;========================================================== | ||
11 | |||
12 | [colors] | ||
13 | background = #40191724 | ||
14 | background_modules = #aaebbcba | ||
15 | foreground = #e0def4 | ||
16 | foreground_modules = #1f1d2e | ||
17 | red = #eb6f92 | ||
18 | green = #9ccfd8 | ||
19 | sold_out_green = #1DB954 | ||
20 | yellow = #f6c177 | ||
21 | blue = #31748f | ||
22 | purple = #ebbcba | ||
23 | pink = #c4a7e7 | ||
24 | |||
25 | [bar/top] | ||
26 | monitor = | ||
27 | width = 100% | ||
28 | height = 20 | ||
29 | offset-x = 0 | ||
30 | offset-y = 0 | ||
31 | radius = 0 | ||
32 | fixed-center = true | ||
33 | |||
34 | background = ${colors.background} | ||
35 | foreground = ${colors.foreground} | ||
36 | |||
37 | border-top-size = 0 | ||
38 | border-bottom-size = 0 | ||
39 | border-top-color = ${colors.background} | ||
40 | border-bottom-color = ${colors.background} | ||
41 | |||
42 | padding = 2 | ||
43 | module-margin = 1 | ||
44 | |||
45 | font-0 = scientifica:antialias=false;1 | ||
46 | font-1 = Siji:size=20;1 | ||
47 | |||
48 | modules-left = i3 pulseaudio-control spotify github | ||
49 | modules-center = xwindow | ||
50 | modules-right = focus backlight battery date time | ||
51 | |||
52 | tray-position = right | ||
53 | |||
54 | [module/github] | ||
55 | type = internal/github | ||
56 | |||
57 | token = ${file:/home/yigit/.local/share/polybar/github_token} | ||
58 | user = yigitsever | ||
59 | empty-notifications = false | ||
60 | interval = 10 | ||
61 | api-url = https://api.github.com/ | ||
62 | |||
63 | format = <label> | ||
64 | label = %notifications% | ||
65 | |||
66 | label-padding = 1 | ||
67 | |||
68 | format-background = ${colors.background_modules} | ||
69 | format-foreground = ${colors.foreground_modules} | ||
70 | |||
71 | format-prefix = | ||
72 | format-prefix-foreground = ${colors.background_modules} | ||
73 | format-prefix-background = ${colors.purple} | ||
74 | format-prefix-padding = 1 | ||
75 | |||
76 | format-offline = <label-offline> | ||
77 | label-offline = Github offline | ||
78 | |||
79 | [module/focus] | ||
80 | type = custom/script | ||
81 | exec = ~/.config/polybar/scripts/focus | ||
82 | double-click-left = exec ~/.config/polybar/scripts/stop & | ||
83 | interval = 1 | ||
84 | |||
85 | [module/spotify] | ||
86 | type = custom/script | ||
87 | interval = 1 | ||
88 | format-prefix = "" | ||
89 | format-prefix-padding = 1 | ||
90 | format-prefix-background = ${colors.sold_out_green} | ||
91 | format-prefix-foreground = ${colors.foreground_modules} | ||
92 | format = <label> | ||
93 | format-padding = 0 | ||
94 | exec = python /usr/share/polybar/scripts/spotify_status.py -f '{play_pause} {artist} - {song}' -p ', ' | ||
95 | ;契 | ||
96 | |||
97 | [module/backlight] | ||
98 | type = internal/xbacklight | ||
99 | |||
100 | format = <ramp><label> | ||
101 | |||
102 | label = %percentage%% | ||
103 | |||
104 | ramp-font = 4 | ||
105 | ramp-background = ${colors.yellow} | ||
106 | ramp-foreground = ${colors.foreground_modules} | ||
107 | ramp-padding = 1 | ||
108 | ramp-0 = | ||
109 | ramp-1 = | ||
110 | ramp-2 = | ||
111 | ramp-3 = | ||
112 | ramp-4 = | ||
113 | |||
114 | label-padding = 1 | ||
115 | label-background = ${colors.background_modules} | ||
116 | label-foreground = ${colors.foreground_modules} | ||
117 | |||
118 | [module/battery] | ||
119 | type = internal/battery | ||
120 | battery = BAT0 | ||
121 | adapter = AC0 | ||
122 | |||
123 | time-format = %H:%M | ||
124 | |||
125 | format-charging = <animation-charging><label-charging> | ||
126 | format-discharging = <ramp-capacity><label-discharging> | ||
127 | |||
128 | ramp-capacity-background = ${colors.red} | ||
129 | ramp-capacity-foreground = ${colors.foreground_modules} | ||
130 | ramp-capacity-padding = 1 | ||
131 | |||
132 | animation-charging-background = ${colors.green} | ||
133 | animation-charging-foreground = ${colors.foreground_modules} | ||
134 | animation-charging-padding = 1 | ||
135 | |||
136 | label-charging = %percentage%% %time% | ||
137 | label-charging-background = ${colors.background_modules} | ||
138 | label-charging-foreground = ${colors.foreground_modules} | ||
139 | label-charging-padding = 1 | ||
140 | |||
141 | label-discharging = %percentage%% %time% | ||
142 | label-discharging-background = ${colors.background_modules} | ||
143 | label-discharging-foreground = ${colors.foreground_modules} | ||
144 | label-discharging-padding = 1 | ||
145 | |||
146 | label-full = | ||
147 | label-full-background = ${colors.yellow} | ||
148 | label-full-foreground = ${colors.foreground_modules} | ||
149 | label-full-padding = 1 | ||
150 | |||
151 | ; Only applies if <ramp-capacity> is used | ||
152 | ramp-capacity-0 = | ||
153 | ramp-capacity-1 = | ||
154 | ramp-capacity-2 = | ||
155 | ramp-capacity-3 = | ||
156 | |||
157 | ; Only applies if <animation-charging> is used | ||
158 | animation-charging-0 = | ||
159 | animation-charging-1 = | ||
160 | animation-charging-2 = | ||
161 | animation-charging-3 = | ||
162 | |||
163 | ; Framerate in milliseconds | ||
164 | animation-charging-framerate = 750 | ||
165 | |||
166 | [module/xwindow] | ||
167 | type = internal/xwindow | ||
168 | format = <label> | ||
169 | label = %title:0:70:...% | ||
170 | |||
171 | y-offset = 10 | ||
172 | label-padding = 1 | ||
173 | label-font = 1 | ||
174 | |||
175 | label-empty = | ||
176 | label-empty-font = 3 | ||
177 | label-empty-padding = 5 | ||
178 | |||
179 | [module/i3] | ||
180 | type = internal/i3 | ||
181 | format = <label-state> | ||
182 | index-sort = true | ||
183 | wrapping-scroll = false | ||
184 | strip-wsnumbers = true | ||
185 | |||
186 | ws-icon-default = | ||
187 | ws-icon-0 = 0; | ||
188 | ws-icon-1 = 1; | ||
189 | ws-icon-2 = 2; | ||
190 | ws-icon-3 = 3; | ||
191 | ws-icon-4 = 4; | ||
192 | ws-icon-5 = 5; | ||
193 | ws-icon-6 = 6; | ||
194 | ws-icon-7 = 7; | ||
195 | ws-icon-8 = 8; | ||
196 | ws-icon-9 = 9; | ||
197 | ws-icon-10 = zotero; | ||
198 | ws-icon-11 = desktop; | ||
199 | ws-icon-12 = browser; | ||
200 | |||
201 | label-mode-background = ${colors.background_modules} | ||
202 | label-mode-foreground = ${colors.foreground_modules} | ||
203 | label-mode-padding = 2 | ||
204 | |||
205 | label-focused = %icon% | ||
206 | label-focused-background = ${colors.yellow} | ||
207 | label-focused-foreground = ${colors.foreground_modules} | ||
208 | label-focused-padding = 1 | ||
209 | |||
210 | label-unfocused = %icon% | ||
211 | label-unfocused-background = ${colors.background_modules} | ||
212 | label-unfocused-foreground = ${colors.foreground_modules} | ||
213 | label-unfocused-padding = 1 | ||
214 | |||
215 | label-visible = %icon% | ||
216 | label-visible-background = ${colors.background_modules} | ||
217 | label-visible-foreground = ${colors.foreground_modules} | ||
218 | label-visible-padding = 1 | ||
219 | |||
220 | label-urgent = %icon% | ||
221 | label-urgent-background = ${colors.red} | ||
222 | label-urgent-foreground = ${colors.foreground_modules} | ||
223 | label-urgent-padding = 1 | ||
224 | |||
225 | label-separator = " " | ||
226 | label-separator-foreground = ${colors.foreground} | ||
227 | label-separator-background = ${colors.purple} | ||
228 | |||
229 | [module/date] | ||
230 | type = internal/date | ||
231 | interval = 1 | ||
232 | |||
233 | date = %Y-%m-%d %A | ||
234 | label = %date% | ||
235 | format = <label> | ||
236 | |||
237 | format-prefix = | ||
238 | format-prefix-background = ${colors.blue} | ||
239 | format-prefix-foreground = ${colors.foreground_modules} | ||
240 | format-prefix-font = 3 | ||
241 | format-prefix-padding = 1 | ||
242 | |||
243 | label-background = ${colors.background_modules} | ||
244 | label-foreground = ${colors.foreground_modules} | ||
245 | label-padding = 1 | ||
246 | |||
247 | [module/time] | ||
248 | type = internal/date | ||
249 | interval = 1 | ||
250 | |||
251 | time = %H:%M | ||
252 | label = %time% | ||
253 | format = <label> | ||
254 | |||
255 | format-prefix = | ||
256 | format-prefix-background = ${colors.green} | ||
257 | format-prefix-foreground = ${colors.foreground_modules} | ||
258 | format-prefix-font = 3 | ||
259 | format-prefix-padding = 1 | ||
260 | |||
261 | label-background = ${colors.background_modules} | ||
262 | label-foreground = ${colors.foreground_modules} | ||
263 | label-padding = 1 | ||
264 | |||
265 | [module/pulseaudio-control] | ||
266 | type = custom/script | ||
267 | tail = true | ||
268 | label = %output% | ||
269 | interval = 5 | ||
270 | |||
271 | exec = ~/.config/polybar/scripts/pulseaudio_control --listen | ||
272 | click-right = exec pavucontrol & | ||
273 | click-left = ~/.config/polybar/scripts/pulseaudio_control --togmute | ||
274 | click-middle = ~/.config/polybar/scripts/pulseaudio_control --change | ||
275 | scroll-up = ~/.config/polybar/scripts/pulseaudio_control --up | ||
276 | scroll-down = ~/.config/polybar/scripts/pulseaudio_control --down | ||
277 | label-padding = 2 | ||
278 | label-foreground = ${colors.foreground_modules} | ||
279 | label-background = ${colors.background_modules} | ||
280 | |||
281 | [settings] | ||
282 | screenchange-reload = true | ||
283 | compositing-background = source | ||
284 | compositing-foreground = source | ||
285 | compositing-border = over | ||
286 | pseudo-transparency = false | ||
287 | |||
288 | [global/wm] | ||
289 | margin-top = 5 | ||
290 | margin-bottom = 5 | ||
291 | ; override-redirect = true | ||
292 | |||
293 | ; vim:ft=dosini | ||
diff --git a/.config/polybar/scripts/focus b/.config/polybar/scripts/focus index 49d46d2..87ee19b 100755 --- a/.config/polybar/scripts/focus +++ b/.config/polybar/scripts/focus | |||
@@ -17,14 +17,22 @@ | |||
17 | 17 | ||
18 | use strict; | 18 | use strict; |
19 | use warnings; | 19 | use warnings; |
20 | use IO::CaptureOutput qw/capture_exec/; | 20 | use Capture::Tiny ':all'; |
21 | 21 | ||
22 | my ($stdout, $stderr, $success, $exit_code) = capture_exec("task custom_focus"); | 22 | my ($stdout, $stderr, $exit_code) = capture { |
23 | system("task custom_focus"); | ||
24 | }; | ||
23 | 25 | ||
24 | if ($stderr =~ /No matches\./) { | 26 | if ($stderr =~ /No matches\./) { |
25 | system 'echo "${SEMESTER_THEME}"'; | 27 | system 'echo "${SEMESTER_THEME}"'; |
26 | exit; | 28 | exit; |
27 | } | 29 | } |
30 | |||
31 | if ($stderr =~ /database is locked/) { | ||
32 | system 'echo "${SEMESTER_THEME}"'; | ||
33 | exit; | ||
34 | } | ||
35 | |||
28 | my $active_task_maybe = $stdout; | 36 | my $active_task_maybe = $stdout; |
29 | 37 | ||
30 | $active_task_maybe =~ s/^\s+|\s+$//g; | 38 | $active_task_maybe =~ s/^\s+|\s+$//g; |
@@ -32,8 +40,9 @@ $active_task_maybe =~ s/^\s+|\s+$//g; | |||
32 | my @lines = split /\n/, $active_task_maybe; | 40 | my @lines = split /\n/, $active_task_maybe; |
33 | 41 | ||
34 | my $task = $lines[2]; | 42 | my $task = $lines[2]; |
35 | $task =~ s/^\s+|\s+$//g; # left and right trim | 43 | $task =~ s/^\s+|\s+$//g; # left and right trim |
36 | $task =~ s/\s+/ /g; # reduce multiple whitespace into one | 44 | $task =~ s/\s+/ /g; # reduce multiple whitespace into one |
45 | $task =~ s/&/&/g; # escape ampersands | ||
37 | 46 | ||
38 | my $context = `task context | grep yes | cut -d' ' -f1`; | 47 | my $context = `task context | grep yes | cut -d' ' -f1`; |
39 | 48 | ||
diff --git a/.config/task/taskrc b/.config/task/taskrc index f37b1ba..d3ea748 100644 --- a/.config/task/taskrc +++ b/.config/task/taskrc | |||
@@ -92,5 +92,5 @@ context.tablet.read=+@tablet | |||
92 | context.tablet.write=+@tablet | 92 | context.tablet.write=+@tablet |
93 | context.work.read=+@work | 93 | context.work.read=+@work |
94 | context.work.write=+@work | 94 | context.work.write=+@work |
95 | news.version=2.6.0 | 95 | news.version=3.3.0 |
96 | sync.local.server_dir=\/home\/yigit\/nextcloud\/virtuals\/taskwarrior\/ | 96 | sync.local.server_dir=\/home\/yigit\/nextcloud\/virtuals\/taskwarrior\/ |
diff --git a/.config/tofi/config b/.config/tofi/config new file mode 100644 index 0000000..af25bad --- /dev/null +++ b/.config/tofi/config | |||
@@ -0,0 +1,314 @@ | |||
1 | # | ||
2 | ### Fonts | ||
3 | # | ||
4 | # Font to use, either a path to a font file or a name. | ||
5 | # | ||
6 | # If a path is given, tofi will startup much quicker, but any | ||
7 | # characters not in the chosen font will fail to render. | ||
8 | # | ||
9 | # Otherwise, fonts are interpreted in Pango format. | ||
10 | font = "/usr/share/fonts/TTF/iosevka-regular.ttc" | ||
11 | |||
12 | # Point size of text. | ||
13 | font-size = 24 | ||
14 | |||
15 | # Comma separated list of OpenType font feature settings to apply, | ||
16 | # if supported by the chosen font. The format is similar to the CSS | ||
17 | # "font-feature-settings" property. | ||
18 | # | ||
19 | # Examples: | ||
20 | # | ||
21 | # font-features = "smcp, c2sc" (all small caps) | ||
22 | # font-features = "liga 0" (disable ligatures) | ||
23 | font-features = "" | ||
24 | |||
25 | # Comma separated list of OpenType font variation settings to apply | ||
26 | # to variable fonts. The format is similar to the CSS | ||
27 | # "font-variation-settings" property. | ||
28 | # | ||
29 | # Examples: | ||
30 | # | ||
31 | # font-variations = "wght 900" (Extra bold) | ||
32 | # font-variations = "wdth 25, slnt -10" (Narrow and slanted) | ||
33 | font-variations = "" | ||
34 | |||
35 | # Perform font hinting. Only applies when a path to a font has been | ||
36 | # specified via `font`. Disabling font hinting speeds up text | ||
37 | # rendering appreciably, but will likely look poor at small font pixel | ||
38 | # sizes. | ||
39 | hint-font = true | ||
40 | |||
41 | # | ||
42 | ### Text theming | ||
43 | # | ||
44 | # Default text color | ||
45 | # | ||
46 | # All text defaults to this color if not otherwise specified. | ||
47 | # text-color = #FFFFFF | ||
48 | |||
49 | # mocha | ||
50 | text-color = #cdd6f4 | ||
51 | prompt-color = #f38ba8 | ||
52 | background-color = #1e1e2e | ||
53 | |||
54 | # All pieces of text have the same theming attributes available: | ||
55 | # | ||
56 | # *-color | ||
57 | # Foreground color | ||
58 | # | ||
59 | # *-background | ||
60 | # Background color | ||
61 | # | ||
62 | # *-background-padding | ||
63 | # Background padding in pixels (comma-delimited, CSS-style list). | ||
64 | # See "DIRECTIONAL VALUES" under `man 5 tofi` for more info. | ||
65 | # | ||
66 | # *-background-corner-radius | ||
67 | # Radius of background box corners in pixels | ||
68 | |||
69 | # Prompt text theme | ||
70 | # prompt-color = #FFFFFF | ||
71 | prompt-background = #00000000 | ||
72 | prompt-background-padding = 0 | ||
73 | prompt-background-corner-radius = 0 | ||
74 | |||
75 | # Placeholder text theme | ||
76 | placeholder-color = #FFFFFFA8 | ||
77 | placeholder-background = #00000000 | ||
78 | placeholder-background-padding = 0 | ||
79 | placeholder-background-corner-radius = 0 | ||
80 | |||
81 | # Input text theme | ||
82 | # input-color = #FFFFFF | ||
83 | input-background = #00000000 | ||
84 | input-background-padding = 0 | ||
85 | input-background-corner-radius = 0 | ||
86 | |||
87 | # Default result text theme | ||
88 | # default-result-color = #FFFFFF | ||
89 | default-result-background = #00000000 | ||
90 | default-result-background-padding = 0 | ||
91 | default-result-background-corner-radius = 0 | ||
92 | |||
93 | # Alternate (even-numbered) result text theme | ||
94 | # | ||
95 | # If unspecified, these all default to the corresponding | ||
96 | # default-result-* attribute. | ||
97 | # | ||
98 | # alternate-result-color = #FFFFFF | ||
99 | # alternate-result-background = #00000000 | ||
100 | # alternate-result-background-padding = 0 | ||
101 | # alternate-result-background-corner-radius = 0 | ||
102 | |||
103 | # Selection text | ||
104 | selection-color = #1e1e2e | ||
105 | selection-background = #f38ba8 | ||
106 | selection-background-padding = 4 | ||
107 | selection-background-corner-radius = 0 | ||
108 | |||
109 | # Matching portion of selection text | ||
110 | selection-match-color = #45475a | ||
111 | |||
112 | # | ||
113 | ### Text cursor theme | ||
114 | # | ||
115 | # Style of the optional text cursor. | ||
116 | # | ||
117 | # Supported values: bar, block, underscore | ||
118 | text-cursor-style = bar | ||
119 | |||
120 | # Color of the text cursor | ||
121 | # | ||
122 | # If unspecified, defaults to the same as input-color | ||
123 | # text-cursor-color = #FFFFFF | ||
124 | |||
125 | # Color of text behind the text cursor when text-cursor-style = block | ||
126 | # | ||
127 | # If unspecified, defaults to the same as background-color | ||
128 | # text-cursor-background = #000000 | ||
129 | |||
130 | # Corner radius of the text cursor | ||
131 | text-cursor-corner-radius = 0 | ||
132 | |||
133 | # Thickness of the bar and underscore text cursors. | ||
134 | # | ||
135 | # If unspecified, defaults to a font-dependent value when | ||
136 | # text-cursor-style = underscore, or to 2 otherwise. | ||
137 | # text-cursor-thickness = 2 | ||
138 | |||
139 | # | ||
140 | ### Text layout | ||
141 | # | ||
142 | # Prompt to display. | ||
143 | prompt-text = "run: " | ||
144 | |||
145 | # Extra horizontal padding between prompt and input. | ||
146 | prompt-padding = 0 | ||
147 | |||
148 | # Placeholder input text. | ||
149 | placeholder-text = "" | ||
150 | |||
151 | # Maximum number of results to display. | ||
152 | # If 0, tofi will draw as many results as it can fit in the window. | ||
153 | num-results = 0 | ||
154 | |||
155 | # Spacing between results in pixels. Can be negative. | ||
156 | result-spacing = 0 | ||
157 | |||
158 | # List results horizontally. | ||
159 | horizontal = false | ||
160 | |||
161 | # Minimum width of input in horizontal mode. | ||
162 | min-input-width = 0 | ||
163 | |||
164 | # | ||
165 | ### Window theming | ||
166 | # | ||
167 | # Width and height of the window. Can be pixels or a percentage. | ||
168 | width = 1280 | ||
169 | height = 720 | ||
170 | |||
171 | # Window background color | ||
172 | # background-color = #1B1D1E | ||
173 | |||
174 | # Width of the border outlines in pixels. | ||
175 | outline-width = 2 | ||
176 | |||
177 | # Border outline color | ||
178 | outline-color = #fab387 | ||
179 | |||
180 | # Width of the border in pixels. | ||
181 | border-width = 4 | ||
182 | |||
183 | # Border color | ||
184 | border-color = #f38ba8 | ||
185 | |||
186 | # Radius of window corners in pixels. | ||
187 | corner-radius = 0 | ||
188 | |||
189 | # Padding between borders and text. Can be pixels or a percentage. | ||
190 | padding-top = 8 | ||
191 | padding-bottom = 8 | ||
192 | padding-left = 8 | ||
193 | padding-right = 8 | ||
194 | |||
195 | # Whether to clip text drawing to be within the specified padding. This | ||
196 | # is mostly important for allowing text to be inset from the border, | ||
197 | # while still allowing text backgrounds to reach right to the edge. | ||
198 | clip-to-padding = true | ||
199 | |||
200 | # Whether to scale the window by the output's scale factor. | ||
201 | scale = true | ||
202 | |||
203 | # | ||
204 | ### Window positioning | ||
205 | # | ||
206 | # The name of the output to appear on. An empty string will use the | ||
207 | # default output chosen by the compositor. | ||
208 | output = "" | ||
209 | |||
210 | # Location on screen to anchor the window to. | ||
211 | # | ||
212 | # Supported values: top-left, top, top-right, right, bottom-right, | ||
213 | # bottom, bottom-left, left, center. | ||
214 | anchor = top | ||
215 | |||
216 | # Set the size of the exclusive zone. | ||
217 | # | ||
218 | # A value of -1 means ignore exclusive zones completely. | ||
219 | # A value of 0 will move tofi out of the way of other windows' zones. | ||
220 | # A value greater than 0 will set that much space as an exclusive zone. | ||
221 | # | ||
222 | # Values greater than 0 are only meaningful when tofi is anchored to a | ||
223 | # single edge. | ||
224 | exclusive-zone = -1 | ||
225 | |||
226 | # Window offset from edge of screen. Only has an effect when anchored | ||
227 | # to the relevant edge. Can be pixels or a percentage. | ||
228 | margin-top = 5% | ||
229 | margin-bottom = 0 | ||
230 | margin-left = 0 | ||
231 | margin-right = 0 | ||
232 | |||
233 | # | ||
234 | ### Behaviour | ||
235 | # | ||
236 | # Hide the mouse cursor. | ||
237 | hide-cursor = false | ||
238 | |||
239 | # Show a text cursor in the input field. | ||
240 | text-cursor = false | ||
241 | |||
242 | # Sort results by number of usages in run and drun modes. | ||
243 | history = true | ||
244 | |||
245 | # Specify an alternate file to read and store history information | ||
246 | # from / to. This shouldn't normally be needed, and is intended to | ||
247 | # facilitate the creation of custom modes. | ||
248 | # history-file = /path/to/histfile | ||
249 | |||
250 | # Select the matching algorithm used. If normal, substring matching is | ||
251 | # used, weighted to favour matches closer to the beginning of the | ||
252 | # string. If prefix, only substrings at the beginning of the string are | ||
253 | # matched. If fuzzy, searching is performed via a simple fuzzy matching | ||
254 | # algorithm. | ||
255 | # | ||
256 | # Supported values: normal, prefix, fuzzy | ||
257 | fuzzy-match = false | ||
258 | |||
259 | # If true, require a match to allow a selection to be made. If false, | ||
260 | # making a selection with no matches will print input to stdout. | ||
261 | # In drun mode, this is always true. | ||
262 | require-match = true | ||
263 | |||
264 | # If true, automatically accept a result if it is the only one | ||
265 | # remaining. If there's only one result on startup, window creation is | ||
266 | # skipped altogether. | ||
267 | auto-accept-single = false | ||
268 | |||
269 | # If true, typed input will be hidden, and what is displayed (if | ||
270 | # anything) is determined by the hidden-character option. | ||
271 | hide-input = false | ||
272 | |||
273 | # Replace displayed input characters with a character. If the empty | ||
274 | # string is given, input will be completely hidden. | ||
275 | # This option only has an effect when hide-input is set to true. | ||
276 | hidden-character = "*" | ||
277 | |||
278 | # Instead of printing the selected entry, print the 1-based index of | ||
279 | # the selection. This option has no effect in run or drun mode. If | ||
280 | # require-match is set to false, non-matching input will still result | ||
281 | # in the input being printed. | ||
282 | # print-index = false | ||
283 | |||
284 | # If true, directly launch applications on selection when in drun mode. | ||
285 | # Otherwise, just print the command line to stdout. | ||
286 | drun-launch = false | ||
287 | |||
288 | # The terminal to run terminal programs in when in drun mode. | ||
289 | # This option has no effect if drun-launch is set to true. | ||
290 | # Defaults to the value of the TERMINAL environment variable. | ||
291 | # terminal = foot | ||
292 | |||
293 | # Delay keyboard initialisation until after the first draw to screen. | ||
294 | # This option is experimental, and will cause tofi to miss keypresses | ||
295 | # for a short time after launch. The only reason to use this option is | ||
296 | # performance on slow systems. | ||
297 | late-keyboard-init = false | ||
298 | |||
299 | # If true, allow multiple simultaneous processes. | ||
300 | # If false, create a lock file on startup to prevent multiple instances | ||
301 | # from running simultaneously. | ||
302 | multi-instance = false | ||
303 | |||
304 | # Assume input is plain ASCII, and disable some Unicode handling | ||
305 | # functions. This is faster, but means e.g. a search for "e" will not | ||
306 | # match "é". | ||
307 | ascii-input = false | ||
308 | |||
309 | # | ||
310 | ### Inclusion | ||
311 | # | ||
312 | # Configs can be split between multiple files, and then included | ||
313 | # within each other. | ||
314 | # include = /path/to/config | ||
diff --git a/.config/user-dirs.dirs b/.config/user-dirs.dirs index 0f87b5b..e13a65c 100644 --- a/.config/user-dirs.dirs +++ b/.config/user-dirs.dirs | |||
@@ -13,3 +13,4 @@ XDG_PUBLICSHARE_DIR="$HOME/.local/share/publicshare" | |||
13 | XDG_MUSIC_DIR="$HOME/music" | 13 | XDG_MUSIC_DIR="$HOME/music" |
14 | XDG_PICTURES_DIR="$HOME/desk/pics" | 14 | XDG_PICTURES_DIR="$HOME/desk/pics" |
15 | XDG_VIDEOS_DIR="$HOME/desk/vids" | 15 | XDG_VIDEOS_DIR="$HOME/desk/vids" |
16 | XDG_SCREENSHOTS_DIR="$HOME/desk/pics/screenshots" | ||
diff --git a/.config/waybar/config.jsonc b/.config/waybar/config.jsonc new file mode 100644 index 0000000..373ac78 --- /dev/null +++ b/.config/waybar/config.jsonc | |||
@@ -0,0 +1,247 @@ | |||
1 | // -*- mode: jsonc -*- | ||
2 | { | ||
3 | "layer": "top", // Waybar at top layer | ||
4 | "position": "top", // Waybar position (top|bottom|left|right) | ||
5 | "height": 20, // Waybar height (to be removed for auto height) | ||
6 | // "width": 1280, // Waybar width | ||
7 | "spacing": 4, // Gaps between modules (4px) | ||
8 | // Choose the order of the modules | ||
9 | "modules-left": [ | ||
10 | "hyprland/workspaces", | ||
11 | "custom/focus" | ||
12 | ], | ||
13 | "modules-center": [ | ||
14 | "hyprland/window" | ||
15 | ], | ||
16 | "modules-right": [ | ||
17 | "mpris", | ||
18 | // "mpd", | ||
19 | // "idle_inhibitor", | ||
20 | "pulseaudio", | ||
21 | // "network", | ||
22 | // "cpu", | ||
23 | // "memory", | ||
24 | // "temperature", | ||
25 | // "backlight", | ||
26 | // "keyboard-state", | ||
27 | // "sway/language", | ||
28 | "battery", | ||
29 | // "battery#bat2", | ||
30 | "clock", | ||
31 | "privacy", | ||
32 | "tray" | ||
33 | ], | ||
34 | // Modules configuration | ||
35 | "hyprland/window": { | ||
36 | "max-length": 40 | ||
37 | }, | ||
38 | "hyprland/workspaces": { | ||
39 | "disable-scroll": true, | ||
40 | "all-outputs": true, | ||
41 | "warp-on-scroll": false, | ||
42 | // "format": "{name}: {icon}", | ||
43 | "format": "{icon}", | ||
44 | "format-icons": { | ||
45 | "1": "1", | ||
46 | "2": "2", | ||
47 | "3": "3", | ||
48 | "4": "4", | ||
49 | "5": "5", | ||
50 | "6": "6", | ||
51 | "7": "7", | ||
52 | "8": "8", | ||
53 | "9": "9", | ||
54 | "desktop": "", | ||
55 | "console": "", | ||
56 | "browser": "", | ||
57 | "zotero": "", | ||
58 | "music": "", | ||
59 | // "urgent": "", | ||
60 | // "active": "◎", | ||
61 | "default": "" | ||
62 | } | ||
63 | }, | ||
64 | "keyboard-state": { | ||
65 | "numlock": true, | ||
66 | "capslock": true, | ||
67 | "format": "{name} {icon}", | ||
68 | "format-icons": { | ||
69 | "locked": "", | ||
70 | "unlocked": "" | ||
71 | } | ||
72 | }, | ||
73 | "sway/mode": { | ||
74 | "format": "<span style=\"italic\">{}</span>" | ||
75 | }, | ||
76 | "sway/scratchpad": { | ||
77 | "format": "{icon} {count}", | ||
78 | "show-empty": false, | ||
79 | "format-icons": ["", ""], | ||
80 | "tooltip": true, | ||
81 | "tooltip-format": "{app}: {title}" | ||
82 | }, | ||
83 | "mpd": { | ||
84 | "format": "{stateIcon} {consumeIcon}{randomIcon}{repeatIcon}{singleIcon}{artist} - {album} - {title} ({elapsedTime:%M:%S}/{totalTime:%M:%S}) ⸨{songPosition}|{queueLength}⸩ {volume}% ", | ||
85 | "format-disconnected": "Disconnected ", | ||
86 | "format-stopped": "{consumeIcon}{randomIcon}{repeatIcon}{singleIcon}Stopped ", | ||
87 | "unknown-tag": "N/A", | ||
88 | "interval": 2, | ||
89 | "consume-icons": { | ||
90 | "on": " " | ||
91 | }, | ||
92 | "random-icons": { | ||
93 | "off": "<span color=\"#f53c3c\"></span> ", | ||
94 | "on": " " | ||
95 | }, | ||
96 | "repeat-icons": { | ||
97 | "on": " " | ||
98 | }, | ||
99 | "single-icons": { | ||
100 | "on": "1 " | ||
101 | }, | ||
102 | "state-icons": { | ||
103 | "paused": "", | ||
104 | "playing": "" | ||
105 | }, | ||
106 | "tooltip-format": "MPD (connected)", | ||
107 | "tooltip-format-disconnected": "MPD (disconnected)" | ||
108 | }, | ||
109 | "idle_inhibitor": { | ||
110 | "format": "{icon}", | ||
111 | "format-icons": { | ||
112 | "activated": "", | ||
113 | "deactivated": "" | ||
114 | } | ||
115 | }, | ||
116 | "tray": { | ||
117 | // "icon-size": 21, | ||
118 | "spacing": 10 | ||
119 | }, | ||
120 | "clock": { | ||
121 | "format": "{:%H:%M | %B %d, %A}", | ||
122 | "tooltip-format": "<tt><small>{calendar}</small></tt>", | ||
123 | }, | ||
124 | "cpu": { | ||
125 | "format": "{usage}% ", | ||
126 | "tooltip": false | ||
127 | }, | ||
128 | "memory": { | ||
129 | "format": "{}% " | ||
130 | }, | ||
131 | "temperature": { | ||
132 | // "thermal-zone": 2, | ||
133 | // "hwmon-path": "/sys/class/hwmon/hwmon2/temp1_input", | ||
134 | "critical-threshold": 80, | ||
135 | // "format-critical": "{temperatureC}°C {icon}", | ||
136 | "format": "{temperatureC}°C {icon}", | ||
137 | "format-icons": ["", "", ""] | ||
138 | }, | ||
139 | "backlight": { | ||
140 | // "device": "acpi_video1", | ||
141 | "format": "{percent}% {icon}", | ||
142 | "format-icons": ["", "", "", "", "", "", "", "", ""] | ||
143 | }, | ||
144 | "battery": { | ||
145 | "states": { | ||
146 | // "good": 95, | ||
147 | "warning": 30, | ||
148 | "critical": 15 | ||
149 | }, | ||
150 | "format": "{capacity}% {icon}", | ||
151 | "format-full": "{capacity}% {icon}", | ||
152 | "format-charging": "{capacity}% ", | ||
153 | "format-plugged": "{capacity}% ", | ||
154 | "format-alt": "{time} {icon}", | ||
155 | // "format-good": "", // An empty format will hide the module | ||
156 | // "format-full": "", | ||
157 | "format-icons": ["", "", "", "", ""] | ||
158 | }, | ||
159 | "battery#bat2": { | ||
160 | "bat": "BAT2" | ||
161 | }, | ||
162 | "network": { | ||
163 | // "interface": "wlp2*", // (Optional) To force the use of this interface | ||
164 | "format-wifi": "{signalStrength}% ", | ||
165 | "format-ethernet": "{ipaddr}/{cidr} ", | ||
166 | "tooltip-format": "{ifname} via {gwaddr} ", | ||
167 | "format-linked": "{ifname} (No IP) ", | ||
168 | "format-disconnected": "Disconnected", | ||
169 | "format-alt": "{ifname}: {ipaddr}/{cidr}" | ||
170 | }, | ||
171 | "pulseaudio": { | ||
172 | // "scroll-step": 1, // %, can be a float | ||
173 | "format": "{volume}% {icon}", | ||
174 | "format-bluetooth": "{volume}% {icon} ", | ||
175 | "format-bluetooth-muted": " {icon} ", | ||
176 | // "format": "{volume}% {icon} {format_source}", | ||
177 | // "format-bluetooth": "{volume}% {icon} {format_source}", | ||
178 | // "format-bluetooth-muted": " {icon} {format_source}", | ||
179 | "format-muted": " ", | ||
180 | // "format-source": "{volume}% ", | ||
181 | // "format-source-muted": "", | ||
182 | "format-icons": { | ||
183 | "headphone": "", | ||
184 | "hands-free": "", | ||
185 | "headset": "", | ||
186 | "phone": "", | ||
187 | "portable": "", | ||
188 | "car": "", | ||
189 | "default": [" ", " ", " "] | ||
190 | }, | ||
191 | "on-click": "pavucontrol" | ||
192 | }, | ||
193 | "custom/media": { | ||
194 | "format": "{icon} {}", | ||
195 | "return-type": "json", | ||
196 | "max-length": 40, | ||
197 | "format-icons": { | ||
198 | "spotify": "", | ||
199 | "default": "🎜" | ||
200 | }, | ||
201 | "escape": true, | ||
202 | "exec": "$HOME/.config/waybar/mediaplayer.py 2> /dev/null" // Script in resources folder | ||
203 | // "exec": "$HOME/.config/waybar/mediaplayer.py --player spotify 2> /dev/null" // Filter player based on name | ||
204 | }, | ||
205 | "mpris": { | ||
206 | "format": "{player_icon} {dynamic}", | ||
207 | "format-paused": "{status_icon} {dynamic}", | ||
208 | "dynamic-len": 36, | ||
209 | "player-icons": { | ||
210 | "default": "", | ||
211 | "mpv": "🎵" | ||
212 | }, | ||
213 | "status-icons": { | ||
214 | "playing": "", | ||
215 | "paused": "", | ||
216 | "stopped": "" | ||
217 | }, | ||
218 | "dynamic-order": [ | ||
219 | "artist", | ||
220 | "title" | ||
221 | ] | ||
222 | // "ignored-players": ["firefox"] | ||
223 | }, | ||
224 | "privacy": { | ||
225 | "icon-spacing": 4, | ||
226 | "icon-size": 18, | ||
227 | "transition-duration": 120, | ||
228 | "modules": [ | ||
229 | { | ||
230 | "type": "screenshare", | ||
231 | "tooltip": true, | ||
232 | "tooltip-icon-size": 24 | ||
233 | }, | ||
234 | { | ||
235 | "type": "audio-in", | ||
236 | "tooltip": true, | ||
237 | "tooltip-icon-size": 24 | ||
238 | } | ||
239 | ] | ||
240 | }, | ||
241 | "custom/focus": { | ||
242 | "exec": "/home/yigit/.config/polybar/scripts/focus", | ||
243 | "interval": 5, | ||
244 | "format": "{}" | ||
245 | } | ||
246 | } | ||
247 | |||
diff --git a/.config/waybar/latte.css b/.config/waybar/latte.css new file mode 100644 index 0000000..085cc3e --- /dev/null +++ b/.config/waybar/latte.css | |||
@@ -0,0 +1,37 @@ | |||
1 | /* | ||
2 | * | ||
3 | * Catppuccin Latte palette | ||
4 | * Maintainer: rubyowo | ||
5 | * | ||
6 | */ | ||
7 | |||
8 | @define-color base #eff1f5; | ||
9 | @define-color mantle #e6e9ef; | ||
10 | @define-color crust #dce0e8; | ||
11 | |||
12 | @define-color text #4c4f69; | ||
13 | @define-color subtext0 #6c6f85; | ||
14 | @define-color subtext1 #5c5f77; | ||
15 | |||
16 | @define-color surface0 #ccd0da; | ||
17 | @define-color surface1 #bcc0cc; | ||
18 | @define-color surface2 #acb0be; | ||
19 | |||
20 | @define-color overlay0 #9ca0b0; | ||
21 | @define-color overlay1 #8c8fa1; | ||
22 | @define-color overlay2 #7c7f93; | ||
23 | |||
24 | @define-color blue #1e66f5; | ||
25 | @define-color lavender #7287fd; | ||
26 | @define-color sapphire #209fb5; | ||
27 | @define-color sky #04a5e5; | ||
28 | @define-color teal #179299; | ||
29 | @define-color green #40a02b; | ||
30 | @define-color yellow #df8e1d; | ||
31 | @define-color peach #fe640b; | ||
32 | @define-color maroon #e64553; | ||
33 | @define-color red #d20f39; | ||
34 | @define-color mauve #8839ef; | ||
35 | @define-color pink #ea76cb; | ||
36 | @define-color flamingo #dd7878; | ||
37 | @define-color rosewater #dc8a78; | ||
diff --git a/.config/waybar/mocha.css b/.config/waybar/mocha.css new file mode 100644 index 0000000..98e218a --- /dev/null +++ b/.config/waybar/mocha.css | |||
@@ -0,0 +1,37 @@ | |||
1 | /* | ||
2 | * | ||
3 | * Catppuccin Mocha palette | ||
4 | * Maintainer: rubyowo | ||
5 | * | ||
6 | */ | ||
7 | |||
8 | @define-color base #1e1e2e; | ||
9 | @define-color mantle #181825; | ||
10 | @define-color crust #11111b; | ||
11 | |||
12 | @define-color text #cdd6f4; | ||
13 | @define-color subtext0 #a6adc8; | ||
14 | @define-color subtext1 #bac2de; | ||
15 | |||
16 | @define-color surface0 #313244; | ||
17 | @define-color surface1 #45475a; | ||
18 | @define-color surface2 #585b70; | ||
19 | |||
20 | @define-color overlay0 #6c7086; | ||
21 | @define-color overlay1 #7f849c; | ||
22 | @define-color overlay2 #9399b2; | ||
23 | |||
24 | @define-color blue #89b4fa; | ||
25 | @define-color lavender #b4befe; | ||
26 | @define-color sapphire #74c7ec; | ||
27 | @define-color sky #89dceb; | ||
28 | @define-color teal #94e2d5; | ||
29 | @define-color green #a6e3a1; | ||
30 | @define-color yellow #f9e2af; | ||
31 | @define-color peach #fab387; | ||
32 | @define-color maroon #eba0ac; | ||
33 | @define-color red #f38ba8; | ||
34 | @define-color mauve #cba6f7; | ||
35 | @define-color pink #f5c2e7; | ||
36 | @define-color flamingo #f2cdcd; | ||
37 | @define-color rosewater #f5e0dc; | ||
diff --git a/.config/waybar/style.css b/.config/waybar/style.css new file mode 100644 index 0000000..7db875f --- /dev/null +++ b/.config/waybar/style.css | |||
@@ -0,0 +1,293 @@ | |||
1 | @import "latte.css"; | ||
2 | |||
3 | * { | ||
4 | border: none; | ||
5 | border-radius: 0; | ||
6 | font-family: FontAwesome, scientifica; | ||
7 | font-size: 14px; | ||
8 | min-height: 0; | ||
9 | box-shadow: none; | ||
10 | text-shadow: none; | ||
11 | transition-duration: 0s; | ||
12 | color: @text; | ||
13 | } | ||
14 | |||
15 | window#waybar { | ||
16 | background-color: @base; | ||
17 | } | ||
18 | |||
19 | window#waybar.hidden { | ||
20 | opacity: 0.2; | ||
21 | } | ||
22 | |||
23 | button { | ||
24 | /* Use box-shadow instead of border so the text isn't offset */ | ||
25 | box-shadow: inset 0 -3px transparent; | ||
26 | /* Avoid rounded borders under each button name */ | ||
27 | border: none; | ||
28 | border-radius: 0; | ||
29 | } | ||
30 | |||
31 | /* https://github.com/Alexays/Waybar/wiki/FAQ#the-workspace-buttons-have-a-strange-hover-effect */ | ||
32 | button:hover { | ||
33 | background: inherit; | ||
34 | box-shadow: inset 0 -3px @overlay0; | ||
35 | } | ||
36 | |||
37 | #workspaces button { | ||
38 | padding: 0 5px; | ||
39 | background-color: transparent; | ||
40 | } | ||
41 | |||
42 | #workspaces button:hover { | ||
43 | background: rgba(0, 0, 0, 0.2); | ||
44 | } | ||
45 | |||
46 | #workspaces button.focused { | ||
47 | background-color: @blue; | ||
48 | box-shadow: inset 0 -3px #ffffff; | ||
49 | } | ||
50 | |||
51 | #workspaces button.urgent { | ||
52 | background-color: #d20f39; | ||
53 | } | ||
54 | |||
55 | #workspaces button.active { | ||
56 | background-color: #a6e3a1; | ||
57 | } | ||
58 | |||
59 | #mode { | ||
60 | background-color: #64727D; | ||
61 | box-shadow: inset 0 -3px #ffffff; | ||
62 | } | ||
63 | |||
64 | #clock, | ||
65 | #battery, | ||
66 | #cpu, | ||
67 | #memory, | ||
68 | #disk, | ||
69 | #temperature, | ||
70 | #backlight, | ||
71 | #network, | ||
72 | #pulseaudio, | ||
73 | #wireplumber, | ||
74 | #custom-media, | ||
75 | #tray, | ||
76 | #mode, | ||
77 | #idle_inhibitor, | ||
78 | #scratchpad, | ||
79 | #mpris, | ||
80 | #mpd { | ||
81 | padding: 0 10px; | ||
82 | } | ||
83 | |||
84 | #window, | ||
85 | #workspaces { | ||
86 | margin: 0 4px; | ||
87 | } | ||
88 | |||
89 | /* If workspaces is the leftmost module, omit left margin */ | ||
90 | .modules-left > widget:first-child > #workspaces { | ||
91 | margin-left: 0; | ||
92 | } | ||
93 | |||
94 | /* If workspaces is the rightmost module, omit right margin */ | ||
95 | .modules-right > widget:last-child > #workspaces { | ||
96 | margin-right: 0; | ||
97 | } | ||
98 | |||
99 | tooltip * { | ||
100 | background: transparent; | ||
101 | } | ||
102 | |||
103 | tooltip.background { | ||
104 | background: @crust; | ||
105 | |||
106 | } | ||
107 | |||
108 | #battery { | ||
109 | background-color: #ffffff; | ||
110 | } | ||
111 | |||
112 | #battery.charging, #battery.plugged { | ||
113 | background-color: #26A65B; | ||
114 | } | ||
115 | |||
116 | @keyframes blink { | ||
117 | to { | ||
118 | background-color: #ffffff; | ||
119 | color: #000000; | ||
120 | } | ||
121 | } | ||
122 | |||
123 | /* Using steps() instead of linear as a timing function to limit cpu usage */ | ||
124 | #battery.critical:not(.charging) { | ||
125 | background-color: #f53c3c; | ||
126 | color: #ffffff; | ||
127 | animation-name: blink; | ||
128 | animation-duration: 0.5s; | ||
129 | animation-timing-function: steps(12); | ||
130 | animation-iteration-count: infinite; | ||
131 | animation-direction: alternate; | ||
132 | } | ||
133 | |||
134 | label:focus { | ||
135 | background-color: #000000; | ||
136 | } | ||
137 | |||
138 | #cpu { | ||
139 | background-color: #2ecc71; | ||
140 | } | ||
141 | |||
142 | #memory { | ||
143 | background-color: #9b59b6; | ||
144 | } | ||
145 | |||
146 | #disk { | ||
147 | background-color: #964B00; | ||
148 | } | ||
149 | |||
150 | #backlight { | ||
151 | background-color: #90b1b1; | ||
152 | } | ||
153 | |||
154 | #network { | ||
155 | background-color: #2980b9; | ||
156 | } | ||
157 | |||
158 | #network.disconnected { | ||
159 | background-color: #f53c3c; | ||
160 | } | ||
161 | |||
162 | #pulseaudio { | ||
163 | background-color: #f1c40f; | ||
164 | } | ||
165 | |||
166 | #pulseaudio.muted { | ||
167 | background-color: #90b1b1; | ||
168 | } | ||
169 | |||
170 | #wireplumber { | ||
171 | background-color: #fff0f5; | ||
172 | } | ||
173 | |||
174 | #wireplumber.muted { | ||
175 | background-color: #f53c3c; | ||
176 | } | ||
177 | |||
178 | #custom-media { | ||
179 | background-color: #66cc99; | ||
180 | min-width: 100px; | ||
181 | } | ||
182 | |||
183 | #custom-media.custom-spotify { | ||
184 | background-color: #66cc99; | ||
185 | } | ||
186 | |||
187 | #custom-media.custom-vlc { | ||
188 | background-color: #ffa000; | ||
189 | } | ||
190 | |||
191 | #temperature { | ||
192 | background-color: #f0932b; | ||
193 | } | ||
194 | |||
195 | #temperature.critical { | ||
196 | background-color: #eb4d4b; | ||
197 | } | ||
198 | |||
199 | #tray { | ||
200 | background-color: @sapphire; | ||
201 | } | ||
202 | |||
203 | #tray > .passive { | ||
204 | -gtk-icon-effect: dim; | ||
205 | } | ||
206 | |||
207 | #tray > .needs-attention { | ||
208 | -gtk-icon-effect: highlight; | ||
209 | background-color: @red; | ||
210 | } | ||
211 | |||
212 | #tray menu { | ||
213 | background-color: @mantle; | ||
214 | color: @text; | ||
215 | } | ||
216 | |||
217 | #idle_inhibitor { | ||
218 | background-color: #2d3436; | ||
219 | } | ||
220 | |||
221 | #idle_inhibitor.activated { | ||
222 | background-color: #ecf0f1; | ||
223 | } | ||
224 | |||
225 | #mpd { | ||
226 | background-color: #66cc99; | ||
227 | } | ||
228 | |||
229 | #mpd.disconnected { | ||
230 | background-color: #f53c3c; | ||
231 | } | ||
232 | |||
233 | #mpd.stopped { | ||
234 | background-color: #90b1b1; | ||
235 | } | ||
236 | |||
237 | #mpd.paused { | ||
238 | background-color: #51a37a; | ||
239 | } | ||
240 | |||
241 | #language { | ||
242 | background: #00b093; | ||
243 | padding: 0 5px; | ||
244 | margin: 0 5px; | ||
245 | min-width: 16px; | ||
246 | } | ||
247 | |||
248 | #keyboard-state { | ||
249 | background: #97e1ad; | ||
250 | padding: 0 0px; | ||
251 | margin: 0 5px; | ||
252 | min-width: 16px; | ||
253 | } | ||
254 | |||
255 | #keyboard-state > label { | ||
256 | padding: 0 5px; | ||
257 | } | ||
258 | |||
259 | #keyboard-state > label.locked { | ||
260 | background: rgba(0, 0, 0, 0.2); | ||
261 | } | ||
262 | |||
263 | #scratchpad { | ||
264 | background: rgba(0, 0, 0, 0.2); | ||
265 | } | ||
266 | |||
267 | #scratchpad.empty { | ||
268 | background-color: transparent; | ||
269 | } | ||
270 | |||
271 | #privacy { | ||
272 | padding: 0; | ||
273 | } | ||
274 | |||
275 | #privacy-item { | ||
276 | padding: 0 5px; | ||
277 | } | ||
278 | |||
279 | #privacy-item.screenshare { | ||
280 | background-color: #cf5700; | ||
281 | } | ||
282 | |||
283 | #privacy-item.audio-in { | ||
284 | background-color: #1ca000; | ||
285 | } | ||
286 | |||
287 | #privacy-item.audio-out { | ||
288 | background-color: #0069d4; | ||
289 | } | ||
290 | |||
291 | #mpris { | ||
292 | background-color: #74c7ec; | ||
293 | } | ||
diff --git a/.config/wlogout/layout b/.config/wlogout/layout new file mode 100644 index 0000000..4c60f4d --- /dev/null +++ b/.config/wlogout/layout | |||
@@ -0,0 +1,36 @@ | |||
1 | { | ||
2 | "label" : "lock", | ||
3 | "action" : "hyprlock", | ||
4 | "text" : "lock", | ||
5 | "keybind" : "l" | ||
6 | } | ||
7 | { | ||
8 | "label" : "hibernate", | ||
9 | "action" : "systemctl hibernate", | ||
10 | "text" : "hibernate", | ||
11 | "keybind" : "h" | ||
12 | } | ||
13 | { | ||
14 | "label" : "logout", | ||
15 | "action" : "loginctl terminate-user $USER", | ||
16 | "text" : "logout", | ||
17 | "keybind" : "e" | ||
18 | } | ||
19 | { | ||
20 | "label" : "shutdown", | ||
21 | "action" : "systemctl poweroff", | ||
22 | "text" : "shutdown", | ||
23 | "keybind" : "s" | ||
24 | } | ||
25 | { | ||
26 | "label" : "suspend", | ||
27 | "action" : "systemctl suspend", | ||
28 | "text" : "suspend", | ||
29 | "keybind" : "u" | ||
30 | } | ||
31 | { | ||
32 | "label" : "reboot", | ||
33 | "action" : "systemctl reboot", | ||
34 | "text" : "reboot", | ||
35 | "keybind" : "r" | ||
36 | } | ||
diff --git a/.config/wlogout/style.css b/.config/wlogout/style.css new file mode 100644 index 0000000..93006f7 --- /dev/null +++ b/.config/wlogout/style.css | |||
@@ -0,0 +1,53 @@ | |||
1 | * { | ||
2 | background-image: none; | ||
3 | box-shadow: none; | ||
4 | } | ||
5 | |||
6 | window { | ||
7 | background-color: rgba(30, 30, 46, 0.9); | ||
8 | } | ||
9 | |||
10 | button { | ||
11 | border-radius: 0; | ||
12 | border-color: black; | ||
13 | text-decoration-color: #b4befe; | ||
14 | color: #cdd6f4; | ||
15 | background-color: #11111b; | ||
16 | border-style: solid; | ||
17 | border-width: 1px; | ||
18 | background-repeat: no-repeat; | ||
19 | background-position: center; | ||
20 | background-size: 25%; | ||
21 | } | ||
22 | |||
23 | button:focus, | ||
24 | button:active, | ||
25 | button:hover { | ||
26 | background-color: #45475a; | ||
27 | color: #f5e0dc; | ||
28 | outline-style: none; | ||
29 | } | ||
30 | |||
31 | #lock { | ||
32 | background-image: image(url("/usr/share/wlogout/icons/lock.png"), url("/usr/local/share/wlogout/icons/lock.png")); | ||
33 | } | ||
34 | |||
35 | #logout { | ||
36 | background-image: image(url("/usr/share/wlogout/icons/logout.png"), url("/usr/local/share/wlogout/icons/logout.png")); | ||
37 | } | ||
38 | |||
39 | #suspend { | ||
40 | background-image: image(url("/usr/share/wlogout/icons/suspend.png"), url("/usr/local/share/wlogout/icons/suspend.png")); | ||
41 | } | ||
42 | |||
43 | #hibernate { | ||
44 | background-image: image(url("/usr/share/wlogout/icons/hibernate.png"), url("/usr/local/share/wlogout/icons/hibernate.png")); | ||
45 | } | ||
46 | |||
47 | #shutdown { | ||
48 | background-image: image(url("/usr/share/wlogout/icons/shutdown.png"), url("/usr/local/share/wlogout/icons/shutdown.png")); | ||
49 | } | ||
50 | |||
51 | #reboot { | ||
52 | background-image: image(url("/usr/share/wlogout/icons/reboot.png"), url("/usr/local/share/wlogout/icons/reboot.png")); | ||
53 | } | ||
diff --git a/.config/yadm/encrypt b/.config/yadm/encrypt index 3f73c6f..3a83a6f 100644 --- a/.config/yadm/encrypt +++ b/.config/yadm/encrypt | |||
@@ -2,9 +2,13 @@ | |||
2 | .ssh/aur.pub | 2 | .ssh/aur.pub |
3 | .ssh/calendar | 3 | .ssh/calendar |
4 | .ssh/calendar.pub | 4 | .ssh/calendar.pub |
5 | .ssh/cispa | ||
6 | .ssh/cispa.pub | ||
5 | .ssh/config | 7 | .ssh/config |
6 | .ssh/gitolite | 8 | .ssh/gitolite |
7 | .ssh/gitolite.pub | 9 | .ssh/gitolite.pub |
8 | .ssh/id_ed25519 | 10 | .ssh/id_ed25519 |
9 | .ssh/id_ed25519.pub | 11 | .ssh/id_ed25519.pub |
12 | .ssh/tm | ||
13 | .ssh/tm.pub | ||
10 | .config/nvchecker/keyfile.toml | 14 | .config/nvchecker/keyfile.toml |
diff --git a/.config/zathura/catppuccin-mocha b/.config/zathura/catppuccin-mocha index 5703c19..ac1c8a3 100644 --- a/.config/zathura/catppuccin-mocha +++ b/.config/zathura/catppuccin-mocha | |||
@@ -33,6 +33,6 @@ set index-active-bg "#313244" | |||
33 | set render-loading-bg "#1E1E2E" | 33 | set render-loading-bg "#1E1E2E" |
34 | set render-loading-fg "#CDD6F4" | 34 | set render-loading-fg "#CDD6F4" |
35 | 35 | ||
36 | set highlight-color "rgba(87, 82, 104, 0.5)" | 36 | set highlight-color "rgba(87, 82, 104, 0.8)" |
37 | set highlight-fg "rgba(245, 194, 231, 0.5)" | 37 | set highlight-fg "#FFFFFF" |
38 | set highlight-active-color "rgba(245, 194, 231, 0.5)" | 38 | set highlight-active-color "rgba(245, 194, 231, 0.5)" |
diff --git a/.config/zathura/zathurarc b/.config/zathura/zathurarc index 1a70a15..fdb3711 100644 --- a/.config/zathura/zathurarc +++ b/.config/zathura/zathurarc | |||
@@ -5,7 +5,6 @@ set guioptions "shv" | |||
5 | set recolor "true" | 5 | set recolor "true" |
6 | set recolor-keephue "true" | 6 | set recolor-keephue "true" |
7 | set synctex "true" | 7 | set synctex "true" |
8 | 8 | set database sqlite | |
9 | set sandbox none | ||
10 | 9 | ||
11 | include catppuccin-mocha | 10 | include catppuccin-mocha |
diff --git a/.local/bin/bukuadd_c b/.local/bin/bukuadd_c index 86f705d..eadd705 100755 --- a/.local/bin/bukuadd_c +++ b/.local/bin/bukuadd_c | |||
@@ -1,8 +1,13 @@ | |||
1 | #!/bin/bash | 1 | #!/usr/bin/env bash |
2 | 2 | ||
3 | #set -e | 3 | if command -v wl-paste &> /dev/null |
4 | url=$(xsel -b) | 4 | then |
5 | tags=$(zenity --entry --text="enter tags for $url") | 5 | url=$(wl-paste) |
6 | tags=$(yad --entry --text="enter tags for $url") | ||
7 | else | ||
8 | url=$(xsel -b) | ||
9 | tags=$(zenity --entry --text="enter tags for $url") | ||
10 | fi | ||
6 | 11 | ||
7 | if [[ $? -ne 0 ]]; then | 12 | if [[ $? -ne 0 ]]; then |
8 | exit 0 | 13 | exit 0 |
diff --git a/.local/bin/done b/.local/bin/done##default index 950541c..950541c 100755 --- a/.local/bin/done +++ b/.local/bin/done##default | |||
diff --git a/.local/bin/done##h.qualle b/.local/bin/done##h.qualle new file mode 100755 index 0000000..d2580ca --- /dev/null +++ b/.local/bin/done##h.qualle | |||
@@ -0,0 +1,62 @@ | |||
1 | #!/usr/bin/env bash | ||
2 | |||
3 | # we `start` tasks through taskwarrior which uses a hook to start them in | ||
4 | # timewarrior | ||
5 | |||
6 | function say_cancel { notify-send "cancelling, no action taken" "" --app-name="done" --icon="dialog-cancel"; } | ||
7 | |||
8 | if ACTIVE_TASK=$(task active); then | ||
9 | # We have a running task | ||
10 | task_id=$(task active_task_id | xargs | cut -d' ' -f3) | ||
11 | task_description=$(echo "${ACTIVE_TASK}" | head -n4 | tail -n1 | cut -d' ' -f2-) | ||
12 | |||
13 | if choice=$(printf "done\npause" | tofi --prompt-text="${task_description}"); then | ||
14 | # complete or pause the task, closing tofi doesn't touch the task | ||
15 | if [[ -z $choice ]]; then | ||
16 | say_cancel | ||
17 | exit | ||
18 | fi | ||
19 | |||
20 | if [[ ${choice} == "done" ]]; then | ||
21 | task "done" "${task_id}" | ||
22 | notify-send "👏 good work there" "task ${task_description} is complete" --app-name="done" --icon="checkmark" | ||
23 | elif [[ ${choice} == "pause" ]]; then | ||
24 | task "stop" "${task_id}" | ||
25 | notify-send "🛑 let's put a pause on this" "stopping task ${task_description}" --app-name="done" --icon="dialog-apply" | ||
26 | else | ||
27 | echo "this is impossible..." | ||
28 | exit 1 | ||
29 | fi | ||
30 | |||
31 | if annot=$(printf "5 - perfect flow\n4 - progress, still\n3 - rather be somewhere else\n2 - ugh\n1 - not even" | tofi --prompt-text="${task_description}"); then | ||
32 | |||
33 | if [[ -z $annot ]]; then | ||
34 | # exited out from annotation, is something wrong? | ||
35 | if maybe_delete=$(printf "no no\nyea" | tofi --prompt-text="should we delete the tracking?"); then | ||
36 | if [[ ${maybe_delete} == "no no" ]]; then | ||
37 | notify-send "tracking unannotated, not deleted" "nobody will know how that went" --app-name="done" --icon="itmages-question" | ||
38 | elif [[ ${maybe_delete} == "yea" ]]; then | ||
39 | timew delete "@1" | ||
40 | notify-send "tracking deleted" "like you never worked on that" --app-name="done" --icon="pack-more" | ||
41 | fi | ||
42 | fi | ||
43 | fi | ||
44 | timew "@1" annotate "${annot:0:1}" | ||
45 | fi | ||
46 | fi | ||
47 | else | ||
48 | # No running task, maybe start one? | ||
49 | if wanna_start=$(printf '%s' "$(task custom_done | tail -n +4 | head -n -2)" | tofi --prompt-text="select a task: "); then | ||
50 | if [[ -z $wanna_start ]]; then # empty, above prompt exited | ||
51 | say_cancel | ||
52 | exit | ||
53 | fi | ||
54 | |||
55 | # picked a task, start it | ||
56 | task_id=$(echo "${wanna_start}" | xargs | cut -d' ' -f1) | ||
57 | task_description=$(echo "${wanna_start}" | xargs | cut -d' ' -f2-) | ||
58 | |||
59 | task "start" "${task_id}" | ||
60 | notify-send "good luck" "${task_description} now" --app-name="done" --icon="go-next" | ||
61 | fi | ||
62 | fi | ||
diff --git a/.local/bin/mailsync b/.local/bin/mailsync index cc7010b..abb4c18 100755 --- a/.local/bin/mailsync +++ b/.local/bin/mailsync | |||
@@ -27,7 +27,14 @@ command -v notify-send > /dev/null || echo 'Note that `libnotify` or `libnotify- | |||
27 | 27 | ||
28 | # Required to display notifications if run as a cronjob: | 28 | # Required to display notifications if run as a cronjob: |
29 | export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$(id -u)/bus | 29 | export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$(id -u)/bus |
30 | export DISPLAY=:0.0 | 30 | |
31 | SESH=$(loginctl show-session $(awk '/tty/ {print $1}' <(loginctl)) -p Type | awk -F= '{print $2}') | ||
32 | |||
33 | if [[ "$SESH" = "wayland" ]]; then | ||
34 | export WAYLAND_DISPLAY=wayland-1 | ||
35 | else | ||
36 | export DISPLAY=:0.0 | ||
37 | fi | ||
31 | 38 | ||
32 | # For individual configurations: | 39 | # For individual configurations: |
33 | [ -d "$HOME/.local/share/password-store" ] && export PASSWORD_STORE_DIR="$HOME/.local/share/password-store" | 40 | [ -d "$HOME/.local/share/password-store" ] && export PASSWORD_STORE_DIR="$HOME/.local/share/password-store" |
@@ -37,8 +44,8 @@ if [ "$(uname)" = "Darwin" ]; then | |||
37 | notify() { osascript -e "display notification \"$2 in $1\" with title \"You've got Mail\" subtitle \"Account: $account\"" && sleep 2; } | 44 | notify() { osascript -e "display notification \"$2 in $1\" with title \"You've got Mail\" subtitle \"Account: $account\"" && sleep 2; } |
38 | messageinfo() { osascript -e "display notification with title \"📧 $from\" subtitle \"$subject\""; } | 45 | messageinfo() { osascript -e "display notification with title \"📧 $from\" subtitle \"$subject\""; } |
39 | else | 46 | else |
40 | notify() { notify-send --icon="mail_new" --app-name="excerpt" "\`$1\`" "📬 $2 new mail(s)"; } | 47 | notify() { notify-send --icon="mail_new" --app-name="mailsync" "\`$1\`" "📬 $2 new mail(s)"; } |
41 | messageinfo() { notify-send --icon="mail-mark-unread" --app-name="mutt" "📧 $from" "$subject"; } | 48 | messageinfo() { notify-send --icon="mail-mark-unread" --app-name="mailsync" "📧 $from" "$subject"; } |
42 | fi | 49 | fi |
43 | 50 | ||
44 | # Check account for new mail. Notify if there is new content. | 51 | # Check account for new mail. Notify if there is new content. |
@@ -60,7 +67,7 @@ syncandnotify() { | |||
60 | 67 | ||
61 | # Sync accounts passed as argument or all. | 68 | # Sync accounts passed as argument or all. |
62 | if [ "$#" -eq "0" ]; then | 69 | if [ "$#" -eq "0" ]; then |
63 | accounts="$(awk '/^Channel/ {print $2}' "$HOME/.mbsyncrc")" | 70 | accounts="$(awk '/^Channel/ {print $2}' "$HOME/.config/isyncrc")" |
64 | else | 71 | else |
65 | for arg in "$@"; do | 72 | for arg in "$@"; do |
66 | [ "${arg%${arg#?}}" = '-' ] && opts="${opts:+${opts} }${arg}" && shift 1 | 73 | [ "${arg%${arg#?}}" = '-' ] && opts="${opts:+${opts} }${arg}" && shift 1 |
@@ -68,15 +75,12 @@ else | |||
68 | accounts=$* | 75 | accounts=$* |
69 | fi | 76 | fi |
70 | 77 | ||
71 | # ( kill -46 "$(pidof "${STATUSBAR:-dwmblocks}")" >/dev/null 2>&1 ) 2>/dev/null | ||
72 | |||
73 | # Parallelize multiple accounts | 78 | # Parallelize multiple accounts |
74 | for account in $accounts; do | 79 | for account in $accounts; do |
75 | syncandnotify & | 80 | syncandnotify & |
76 | done | 81 | done |
77 | 82 | ||
78 | wait | 83 | wait |
79 | # ( kill -46 "$(pidof "${STATUSBAR:-dwmblocks}")" >/dev/null 2>&1 ) 2>/dev/null | ||
80 | 84 | ||
81 | notmuch new 2> /dev/null | 85 | notmuch new 2> /dev/null |
82 | 86 | ||
diff --git a/.local/bin/nuke b/.local/bin/nuke index c287b5a..e2925b6 100755 --- a/.local/bin/nuke +++ b/.local/bin/nuke | |||
@@ -212,7 +212,7 @@ handle_extension() { | |||
212 | exit 1;; | 212 | exit 1;; |
213 | 213 | ||
214 | ## OpenDocument | 214 | ## OpenDocument |
215 | odt|ods|odp|sxw) | 215 | odt|ods|odp|sxw|docx) |
216 | if type odt2txt >/dev/null 2>&1; then | 216 | if type odt2txt >/dev/null 2>&1; then |
217 | ## Preview as text conversion | 217 | ## Preview as text conversion |
218 | odt2txt "${FPATH}" | eval "$PAGER" | 218 | odt2txt "${FPATH}" | eval "$PAGER" |
@@ -227,7 +227,7 @@ handle_extension() { | |||
227 | ## Markdown | 227 | ## Markdown |
228 | md) | 228 | md) |
229 | if type glow >/dev/null 2>&1; then | 229 | if type glow >/dev/null 2>&1; then |
230 | glow -sdark "${FPATH}" | eval "$PAGER" | 230 | glow -p "${FPATH}" |
231 | exit 0 | 231 | exit 0 |
232 | elif type lowdown >/dev/null 2>&1; then | 232 | elif type lowdown >/dev/null 2>&1; then |
233 | lowdown -Tterm "${FPATH}" | eval "$PAGER" | 233 | lowdown -Tterm "${FPATH}" | eval "$PAGER" |
@@ -331,6 +331,9 @@ handle_multimedia() { | |||
331 | elif type nsxiv >/dev/null 2>&1; then | 331 | elif type nsxiv >/dev/null 2>&1; then |
332 | load_dir nsxiv "${FPATH}" >/dev/null 2>&1 & | 332 | load_dir nsxiv "${FPATH}" >/dev/null 2>&1 & |
333 | exit 0 | 333 | exit 0 |
334 | elif type imv >/dev/null 2>&1; then | ||
335 | imv "${FPATH}" >/dev/null 2>&1 & | ||
336 | exit 0 | ||
334 | fi | 337 | fi |
335 | elif type viu >/dev/null 2>&1; then | 338 | elif type viu >/dev/null 2>&1; then |
336 | viu -n "${FPATH}" | eval "$PAGER" | 339 | viu -n "${FPATH}" | eval "$PAGER" |
diff --git a/.local/bin/rem2html b/.local/bin/rem2html new file mode 100755 index 0000000..f298fb3 --- /dev/null +++ b/.local/bin/rem2html | |||
@@ -0,0 +1,790 @@ | |||
1 | #!/usr/bin/env perl | ||
2 | # SPDX-License-Identifier: GPL-2.0-only | ||
3 | |||
4 | use strict; | ||
5 | use warnings; | ||
6 | |||
7 | use Getopt::Long; | ||
8 | use JSON::MaybeXS; | ||
9 | |||
10 | my %Options; | ||
11 | |||
12 | my $rem2html_version = '2.1'; | ||
13 | |||
14 | my($days, $shades, $moons, $classes, $Month, $Year, $Numdays, $Firstwkday, $Mondayfirst, $weeks, | ||
15 | @Daynames, $Nextmon, $Nextlen, $Prevmon, $Prevlen); | ||
16 | |||
17 | my $TIDY_PROGNAME = $0; | ||
18 | $TIDY_PROGNAME =~ s|^.*/||; | ||
19 | |||
20 | # rem2html -- convert the output of "remind -pp" to HTML | ||
21 | |||
22 | =head1 NAME | ||
23 | |||
24 | rem2html - Convert the output of "remind -pp" to HTML | ||
25 | |||
26 | =head1 SYNOPSIS | ||
27 | |||
28 | remind -pp ... | rem2html [options] | ||
29 | |||
30 | You can also use the old interchange format as below, but the -pp | ||
31 | version is preferred. | ||
32 | |||
33 | remind -p ... | rem2html [options] | ||
34 | |||
35 | =head1 OPTIONS | ||
36 | |||
37 | =over 4 | ||
38 | |||
39 | =item --help, -h | ||
40 | |||
41 | Print usage information | ||
42 | |||
43 | =item --version | ||
44 | |||
45 | Print version | ||
46 | |||
47 | =item --backurl I<url> | ||
48 | |||
49 | When producing the small calendar for the previous month, make the | ||
50 | month name a link to I<url>. | ||
51 | |||
52 | =item --forwurl I<url> | ||
53 | |||
54 | When producing the small calendar for the next month, make the | ||
55 | month name a link to I<url>. | ||
56 | |||
57 | =item --imgbase I<url> | ||
58 | |||
59 | When creating URLs for the stylesheet or external images, use I<url> | ||
60 | as the base URL. | ||
61 | |||
62 | =item --pngs | ||
63 | |||
64 | Normally, rem2html uses inline "data:" URLs for the moon phase images, | ||
65 | yielding a standalone HTML file. The C<--pngs> option makes it use | ||
66 | external images named firstquarter.png, fullmoon.png, lastquarter.png | ||
67 | and newmoon.png, which are expected to live in C<--imgbase>. | ||
68 | |||
69 | =item --stylesheet I<url.css> | ||
70 | |||
71 | Use I<url.css> as the stylesheet. If this option is used, | ||
72 | I<url.css> is interpreted relative to B<imgbase> I<unless> it starts | ||
73 | with a "/". | ||
74 | |||
75 | =item --nostyle | ||
76 | |||
77 | Produce basic HTML that does not use a CSS stylesheet. | ||
78 | |||
79 | =item --tableonly | ||
80 | |||
81 | Output results as a E<lt>tableE<gt> ... E<lt>/tableE<gt> sequence only | ||
82 | without any E<lt>htmlE<gt> or E<lt>bodyE<gt> tags. | ||
83 | |||
84 | =item --title I<title> | ||
85 | |||
86 | Use I<title> as the content between E<lt>titleE<gt> and E<lt>/titleE<gt> | ||
87 | tags. | ||
88 | |||
89 | |||
90 | =item --prologue I<html_text> | ||
91 | |||
92 | Insert I<html_text> right after the E<lt>bodyE<gt> tag. | ||
93 | |||
94 | =item --epilogue I<html_text> | ||
95 | |||
96 | Insert I<html_text> right before the E<lt>/bodyE<gt> tag. | ||
97 | |||
98 | =back | ||
99 | |||
100 | =head1 SPECIALS SUPPORTED | ||
101 | |||
102 | The rem2html back-end supports the following SPECIAL reminders: | ||
103 | |||
104 | =over | ||
105 | |||
106 | =item HTML | ||
107 | |||
108 | Add an HTML reminder to the calendar. All HTML tags are available. | ||
109 | |||
110 | =item HTMLCLASS | ||
111 | |||
112 | Add a CSS class to the box representing the trigger date. See | ||
113 | "HIGHLIGHTING TODAY" for an example | ||
114 | |||
115 | =item WEEK, MOON, SHARE, COLOR | ||
116 | |||
117 | The standard SPECIALs supported by all back-ends | ||
118 | |||
119 | =back | ||
120 | |||
121 | =head1 HIGHLIGHTING TODAY | ||
122 | |||
123 | Older versions of rem2html used to highlight today's date with a red outline. | ||
124 | The current version does not do that by default. If you wish to highlight | ||
125 | today's date, add the following reminder to your reminders file: | ||
126 | |||
127 | REM [realtoday()] SPECIAL HTMLCLASS rem-today | ||
128 | |||
129 | =head1 AUTHOR | ||
130 | |||
131 | rem2html was written by Dianne Skoll with much inspiration from an | ||
132 | earlier version by Don Schwarz. | ||
133 | |||
134 | =head1 HOME PAGE | ||
135 | |||
136 | L<https://dianne.skoll.ca/projects/remind/> | ||
137 | |||
138 | =head1 SEE ALSO | ||
139 | |||
140 | B<remind>, B<rem2ps>, B<rem2pdf>, B<tkremind> | ||
141 | =cut | ||
142 | |||
143 | sub usage | ||
144 | { | ||
145 | my ($exit_status) = @_; | ||
146 | if (!defined($exit_status)) { | ||
147 | $exit_status = 1; | ||
148 | } | ||
149 | print STDERR <<"EOM"; | ||
150 | $TIDY_PROGNAME: Produce an HTML calendar from the output of "remind -pp" | ||
151 | |||
152 | Usage: remind -pp ... | rem2html [options] | ||
153 | |||
154 | Options: | ||
155 | |||
156 | --help, -h Print usage information | ||
157 | --man Show man page (requires "perldoc") | ||
158 | --version Print version | ||
159 | --backurl url Make the title on the previous month's small calendar | ||
160 | entry a link to <url> | ||
161 | --forwurl url Same as --backurl, but for the next month's small calendar | ||
162 | --imgbase url Base URL of images and default stylesheet file | ||
163 | --pngs Use external .PNG images for moon phases rater than | ||
164 | inline data: URLs | ||
165 | --stylesheet url.css URL of CSS stylesheet. If specified, imgbase is NOT | ||
166 | prepended to url.css | ||
167 | --nostyle Produce basic HTML that does not use a CSS stylesheet | ||
168 | --tableonly Output results as a <table> only, no <html>, <body>, etc. | ||
169 | --title string What to put in <title>...</title> tags | ||
170 | --prologue html_text Text to insert at the top of the body | ||
171 | --epilogue html_text Text to insert at the end of the body | ||
172 | EOM | ||
173 | exit($exit_status); | ||
174 | } | ||
175 | |||
176 | sub smoosh | ||
177 | { | ||
178 | my ($first, $second) = @_; | ||
179 | return $second unless defined ($first); | ||
180 | return $second if $first eq ''; | ||
181 | return $second if ($second =~ m|^/|); # Absolute path given for second | ||
182 | |||
183 | # Squash multiple slashes | ||
184 | $first =~ s|/+|/|g; | ||
185 | |||
186 | # Special case | ||
187 | return "/$second" if ($first eq '/'); | ||
188 | |||
189 | # Delete trailing slash | ||
190 | $first =~ s|/$||; | ||
191 | |||
192 | return "$first/$second"; | ||
193 | } | ||
194 | |||
195 | sub parse_options | ||
196 | { | ||
197 | local $SIG{__WARN__} = sub { print STDERR "$TIDY_PROGNAME: $_[0]\n"; }; | ||
198 | if (!GetOptions(\%Options, "help|h", | ||
199 | "man", | ||
200 | "pngs", | ||
201 | "version", | ||
202 | "stylesheet=s", | ||
203 | "nostyle", | ||
204 | "backurl=s", | ||
205 | "forwurl=s", | ||
206 | "title=s", | ||
207 | "prologue=s", | ||
208 | "epilogue=s", | ||
209 | "imgbase=s", | ||
210 | "tableonly")) { | ||
211 | usage(1); | ||
212 | } | ||
213 | $Options{title} ||= 'HTML Calendar'; | ||
214 | |||
215 | my $stylesheet = $Options{stylesheet}; | ||
216 | if ($stylesheet) { | ||
217 | $Options{stylesheet} = smoosh($Options{imgbase}, $stylesheet); | ||
218 | } | ||
219 | } | ||
220 | |||
221 | sub start_output | ||
222 | { | ||
223 | return if ($Options{tableonly}); | ||
224 | |||
225 | print("<!doctype html>\n"); | ||
226 | print("<html>\n<head>\n<title>" . $Options{title} . "</title>\n"); | ||
227 | print('<meta charset="utf-8">' . "\n"); | ||
228 | print('<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">' . "\n"); | ||
229 | if (!$Options{nostyle}) { | ||
230 | if ($Options{stylesheet}) { | ||
231 | print('<link rel="stylesheet" type="text/css" href="' . | ||
232 | $Options{stylesheet} . '">' . "\n"); | ||
233 | } else { | ||
234 | print("<style>\n"); | ||
235 | print default_stylesheet(); | ||
236 | print("</style>\n"); | ||
237 | } | ||
238 | } | ||
239 | print("</head>\n<body>\n"); | ||
240 | if ($Options{prologue}) { | ||
241 | print $Options{prologue} . "\n"; | ||
242 | } | ||
243 | } | ||
244 | |||
245 | sub end_output | ||
246 | { | ||
247 | return if ($Options{tableonly}); | ||
248 | if ($Options{epilogue}) { | ||
249 | print $Options{epilogue} . "\n"; | ||
250 | } | ||
251 | print("</body>\n</html>\n"); | ||
252 | } | ||
253 | |||
254 | sub parse_input | ||
255 | { | ||
256 | undef $days; | ||
257 | undef $shades; | ||
258 | undef $moons; | ||
259 | undef $classes; | ||
260 | undef $weeks; | ||
261 | |||
262 | my $found_data = 0; | ||
263 | while(<STDIN>) { | ||
264 | chomp; | ||
265 | last if /^\# rem2ps2? begin$/; | ||
266 | } | ||
267 | |||
268 | my $line; | ||
269 | # Month Year numdays firstday monday_first_flag | ||
270 | $line = <STDIN>; | ||
271 | return 0 unless $line; | ||
272 | chomp($line); | ||
273 | ($Month, $Year, $Numdays, $Firstwkday, $Mondayfirst) = split(' ', $line); | ||
274 | |||
275 | $Month =~ s/_/ /g; | ||
276 | # Day names | ||
277 | $line = <STDIN>; | ||
278 | return 0 unless $line; | ||
279 | chomp($line); | ||
280 | @Daynames = split(' ', $line); | ||
281 | |||
282 | for (my $i=0; $i<7; $i++) { | ||
283 | $Daynames[$i] =~ s/_/ /g; | ||
284 | } | ||
285 | |||
286 | # Prevmon prevlen | ||
287 | $line = <STDIN>; | ||
288 | return 0 unless $line; | ||
289 | chomp($line); | ||
290 | ($Prevmon, $Prevlen) = split(' ', $line); | ||
291 | $Prevmon =~ s/_/ /g; | ||
292 | |||
293 | # Nextmon nextlen | ||
294 | $line = <STDIN>; | ||
295 | return 0 unless $line; | ||
296 | chomp($line); | ||
297 | ($Nextmon, $Nextlen) = split(' ', $line); | ||
298 | $Nextmon =~ s/_/ /g; | ||
299 | |||
300 | $found_data = 1; | ||
301 | my $class; | ||
302 | if ($Options{nostyle}) { | ||
303 | $class = ''; | ||
304 | } else { | ||
305 | $class = ' class="rem-entry"'; | ||
306 | } | ||
307 | while(<STDIN>) { | ||
308 | chomp; | ||
309 | last if /^\# rem2ps2? end$/; | ||
310 | next if /^\#/; | ||
311 | my ($y, $m, $d, $special, $tag, $duration, $time, $body); | ||
312 | if (m/^(\d*).(\d*).(\d*)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s*(.*)$/) { | ||
313 | ($y, $m, $d, $special, $tag, $duration, $time, $body) = | ||
314 | ($1, $2, $3, $4, $5, $6, $7, $8); | ||
315 | } elsif (/\{/) { | ||
316 | my $obj = decode_json($_); | ||
317 | next unless ($obj->{date} =~ /^(\d+)-(\d+)-(\d+)$/); | ||
318 | $y = $1; | ||
319 | $m = $2; | ||
320 | $d = $3; | ||
321 | $special = $obj->{passthru} || '*'; | ||
322 | $tag = $obj->{tags} || '*'; | ||
323 | $duration = $obj->{duration} || '*'; | ||
324 | $time = $obj->{time} || '*'; | ||
325 | $body = $obj->{body}; | ||
326 | } else { | ||
327 | next; | ||
328 | } | ||
329 | my $d1 = $d; | ||
330 | $d1 =~ s/^0+//; | ||
331 | $special = uc($special); | ||
332 | if ($special eq 'HTML') { | ||
333 | push(@{$days->[$d]}, $body); | ||
334 | } elsif ($special eq 'HTMLCLASS') { | ||
335 | $classes->[$d] = $body; | ||
336 | } elsif ($special eq 'WEEK') { | ||
337 | $body =~ s/^\s+//; | ||
338 | $body =~ s/\s+$//; | ||
339 | $weeks->{$d1} = $body; | ||
340 | } elsif ($special eq 'MOON') { | ||
341 | if ($body =~ /(\S+)\s+(\S+)\s+(\S+)\s+(.*)$/) { | ||
342 | my ($phase, $moonsize, $fontsize, $msg) = ($1, $2, $3, $4); | ||
343 | $moons->[$d]->{'phase'} = $phase; | ||
344 | $moons->[$d]->{'msg'} = $msg; | ||
345 | } elsif ($body =~ /(\S+)/) { | ||
346 | $moons->[$d]->{'phase'} = $1; | ||
347 | $moons->[$d]->{'msg'} = ''; | ||
348 | } | ||
349 | } elsif ($special eq 'SHADE') { | ||
350 | if ($body =~ /(\d+)\s+(\d+)\s+(\d+)/) { | ||
351 | $shades->[$d] = sprintf("#%02X%02X%02X", | ||
352 | ($1 % 256), ($2 % 256), ($3 % 256)); | ||
353 | } elsif ($body =~ /(\d+)/) { | ||
354 | $shades->[$d] = sprintf("#%02X%02X%02X", | ||
355 | ($1 % 256), ($1 % 256), ($1 % 256)); | ||
356 | } | ||
357 | } elsif ($special eq 'COLOR' || $special eq 'COLOUR') { | ||
358 | if ($body =~ /(\d+)\s+(\d+)\s+(\d+)\s+(.*)$/) { | ||
359 | my($r, $g, $b, $text) = ($1, $2, $3, $4); | ||
360 | my $color = sprintf("style=\"color: #%02X%02X%02X;\"", | ||
361 | $r % 256, $g % 256, $b % 256); | ||
362 | push(@{$days->[$d]}, "<p$class $color>" . escape_html($text) . '</p>'); | ||
363 | } | ||
364 | } elsif ($special eq '*') { | ||
365 | push(@{$days->[$d]}, "<p$class>" . escape_html($body) . '</p>'); | ||
366 | } | ||
367 | } | ||
368 | return $found_data; | ||
369 | } | ||
370 | |||
371 | sub small_calendar | ||
372 | { | ||
373 | my($month, $monlen, $url, $first_col) = @_; | ||
374 | if ($Mondayfirst) { | ||
375 | $first_col--; | ||
376 | if ($first_col < 0) { | ||
377 | $first_col = 6; | ||
378 | } | ||
379 | } | ||
380 | |||
381 | if ($Options{nostyle}) { | ||
382 | print "<td width=\"14%\">\n"; | ||
383 | print "<table border=\"0\">\n"; | ||
384 | print "<caption>"; | ||
385 | } else { | ||
386 | print "<td class=\"rem-small-calendar\">\n"; | ||
387 | print "<table class=\"rem-sc-table\">\n"; | ||
388 | print "<caption class=\"rem-sc-caption\">"; | ||
389 | } | ||
390 | print "<a href=\"$url\">" if ($url); | ||
391 | print $month; | ||
392 | print "</a>" if ($url); | ||
393 | print "</caption>\n"; | ||
394 | |||
395 | my $class; | ||
396 | if ($Options{nostyle}) { | ||
397 | print '<tr>'; | ||
398 | $class = ' align="right"'; | ||
399 | } else { | ||
400 | print '<tr class="rem-sc-hdr-row">'; | ||
401 | $class = ' class="rem-sc-hdr"'; | ||
402 | } | ||
403 | if (!$Mondayfirst) { | ||
404 | print "<th$class>" . substr($Daynames[0], 0, 1) . '</th>'; | ||
405 | } | ||
406 | for (my $i=1; $i<7; $i++) { | ||
407 | print "<th$class>" . substr($Daynames[$i], 0, 1) . '</th>'; | ||
408 | } | ||
409 | if ($Mondayfirst) { | ||
410 | print "<th$class>" . substr($Daynames[0], 0, 1) . '</th>'; | ||
411 | } | ||
412 | print("</tr>\n"); | ||
413 | my $col = 0; | ||
414 | for (; $col<$first_col; $col++) { | ||
415 | if ($col == 0) { | ||
416 | print("<tr>\n"); | ||
417 | } | ||
418 | if ($Options{nostyle}) { | ||
419 | print("<td align=\"right\" width=\"14%\"> </td>"); | ||
420 | } else { | ||
421 | print("<td class=\"rem-sc-empty-cell\"> </td>"); | ||
422 | } | ||
423 | } | ||
424 | |||
425 | for (my $day=1; $day <= $monlen; $day++) { | ||
426 | if ($col == 0) { | ||
427 | print("<tr>\n"); | ||
428 | } | ||
429 | $col++; | ||
430 | if ($Options{nostyle}) { | ||
431 | print("<td align=\"right\" width=\"14%\">$day</td>"); | ||
432 | } else { | ||
433 | print("<td class=\"rem-sc-cell\">$day</td>"); | ||
434 | } | ||
435 | if ($col == 7) { | ||
436 | print("</tr>\n"); | ||
437 | $col = 0; | ||
438 | } | ||
439 | } | ||
440 | if ($col) { | ||
441 | while ($col < 7) { | ||
442 | if ($Options{nostyle}) { | ||
443 | print("<td align=\"right\" width=\"14%\"> </td>"); | ||
444 | } else { | ||
445 | print("<td class=\"rem-sc-empty-cell\"> </td>"); | ||
446 | } | ||
447 | $col++; | ||
448 | } | ||
449 | print("</tr>\n"); | ||
450 | } | ||
451 | print("</table>\n"); | ||
452 | print "</td>\n"; | ||
453 | } | ||
454 | |||
455 | sub output_calendar | ||
456 | { | ||
457 | # Which column is 1st of month in? | ||
458 | my $first_col = $Firstwkday; | ||
459 | if ($Mondayfirst) { | ||
460 | $first_col--; | ||
461 | if ($first_col < 0) { | ||
462 | $first_col = 6; | ||
463 | } | ||
464 | } | ||
465 | |||
466 | # Last column | ||
467 | my $last_col = ($first_col + $Numdays - 1) % 7; | ||
468 | |||
469 | # Figure out how many rows | ||
470 | my $number_of_rows = int(($first_col + $Numdays ) / 7 + 0.999); | ||
471 | |||
472 | # Add a row for small calendars if necessary | ||
473 | if ($first_col == 0 && $last_col == 6) { | ||
474 | $number_of_rows++; | ||
475 | } | ||
476 | |||
477 | # Start the table | ||
478 | my $class; | ||
479 | if ($Options{nostyle}) { | ||
480 | print '<table width="100%" border="1" cellspacing=\"0\"><caption>' . | ||
481 | $Month . ' ' . $Year . '</caption>' . "\n"; | ||
482 | print '<tr>'; | ||
483 | $class = ' width="14%"'; | ||
484 | } else { | ||
485 | print '<table class="rem-cal"><caption class="rem-cal-caption">' . | ||
486 | $Month . ' ' . $Year . '</caption>' . "\n"; | ||
487 | print '<tr class="rem-cal-hdr-row">'; | ||
488 | $class = ' class="rem-cal-hdr"'; | ||
489 | } | ||
490 | if (!$Mondayfirst) { | ||
491 | print "<th$class>" . $Daynames[0] . '</th>'; | ||
492 | } | ||
493 | for (my $i=1; $i<7; $i++) { | ||
494 | print "<th$class>" . $Daynames[$i] . '</th>'; | ||
495 | } | ||
496 | if ($Mondayfirst) { | ||
497 | print "<th$class>" . $Daynames[0] . '</th>'; | ||
498 | } | ||
499 | print "</tr>\n"; | ||
500 | |||
501 | # Start the calendar rows | ||
502 | my $col = 0; | ||
503 | if ($Options{nostyle}) { | ||
504 | print "<tr>\n"; | ||
505 | } else { | ||
506 | print "<tr class=\"rem-cal-row rem-cal-row-$number_of_rows-rows\">\n"; | ||
507 | } | ||
508 | if ($first_col > 0) { | ||
509 | small_calendar($Prevmon, $Prevlen, $Options{backurl}, | ||
510 | ($Firstwkday - $Prevlen + 35) % 7); | ||
511 | $col++; | ||
512 | } | ||
513 | |||
514 | if ($last_col == 6 && $first_col > 0) { | ||
515 | small_calendar($Nextmon, $Nextlen, $Options{forwurl}, | ||
516 | ($Firstwkday + $Numdays) % 7); | ||
517 | $col++; | ||
518 | } | ||
519 | if ($Options{nostyle}) { | ||
520 | $class = ' width="14%"'; | ||
521 | } else { | ||
522 | $class = ' class="rem-empty rem-empty-$number_of_rows-rows"'; | ||
523 | } | ||
524 | while ($col < $first_col) { | ||
525 | print("<td$class> </td>\n"); | ||
526 | $col++; | ||
527 | } | ||
528 | |||
529 | for (my $day=1; $day<=$Numdays; $day++) { | ||
530 | draw_day_cell($day, $number_of_rows); | ||
531 | $col++; | ||
532 | if ($col == 7) { | ||
533 | $col = 0; | ||
534 | print "</tr>\n"; | ||
535 | if ($day < $Numdays) { | ||
536 | if ($Options{nostyle}) { | ||
537 | print "<tr>\n"; | ||
538 | } else { | ||
539 | print "<tr class=\"rem-cal-row rem-cal-row-$number_of_rows-rows\">\n"; | ||
540 | } | ||
541 | } | ||
542 | } | ||
543 | } | ||
544 | |||
545 | if ($col) { | ||
546 | while ($col < 7) { | ||
547 | if ($col == 5) { | ||
548 | if ($first_col == 0) { | ||
549 | small_calendar($Prevmon, $Prevlen, $Options{backurl}, | ||
550 | ($Firstwkday - $Prevlen + 35) % 7); | ||
551 | } else { | ||
552 | print("<td$class> </td>\n"); | ||
553 | } | ||
554 | } elsif ($col == 6) { | ||
555 | small_calendar($Nextmon, $Nextlen, $Options{forwurl}, | ||
556 | ($Firstwkday + $Numdays) % 7); | ||
557 | } else { | ||
558 | print("<td$class> </td>\n"); | ||
559 | } | ||
560 | $col++; | ||
561 | } | ||
562 | print "</tr>\n"; | ||
563 | } | ||
564 | |||
565 | # Add a row for small calendars if they were not yet done! | ||
566 | if ($first_col == 0 && $last_col == 6) { | ||
567 | if ($Options{nostyle}) { | ||
568 | print "<tr>\n"; | ||
569 | } else { | ||
570 | print "<tr class=\"rem-cal-row rem-cal-row-$number_of_rows-rows\">\n"; | ||
571 | } | ||
572 | small_calendar($Prevmon, $Prevlen, $Options{backurl}, | ||
573 | ($Firstwkday - $Prevlen + 35) % 7); | ||
574 | for (my $i=0; $i<5; $i++) { | ||
575 | print("<td$class> </td>\n"); | ||
576 | } | ||
577 | small_calendar($Nextmon, $Nextlen, $Options{forwurl}, | ||
578 | ($Firstwkday + $Numdays) % 7); | ||
579 | print("</tr>\n"); | ||
580 | } | ||
581 | # End the table | ||
582 | print "</table>\n"; | ||
583 | } | ||
584 | |||
585 | sub draw_day_cell | ||
586 | { | ||
587 | my($day, $number_of_rows) = @_; | ||
588 | my $shade = $shades->[$day]; | ||
589 | my $week = ''; | ||
590 | if (exists($weeks->{$day})) { | ||
591 | $week = ' ' . $weeks->{$day}; | ||
592 | } | ||
593 | my $class; | ||
594 | if ($Options{nostyle}) { | ||
595 | $class = $classes->[$day] || ''; | ||
596 | } else { | ||
597 | $class = $classes->[$day] || "rem-cell rem-cell-$number_of_rows-rows"; | ||
598 | } | ||
599 | if ($shade) { | ||
600 | $shade = " style=\"background: $shade;\""; | ||
601 | } else { | ||
602 | $shade = ""; | ||
603 | } | ||
604 | if ($class ne '') { | ||
605 | print "<td class=\"$class\"$shade>\n"; | ||
606 | } else { | ||
607 | print "<td valign=\"top\" $shade>\n"; | ||
608 | } | ||
609 | if ($moons->[$day]) { | ||
610 | my $phase = $moons->[$day]->{'phase'}; | ||
611 | my $msg = $moons->[$day]->{'msg'}; | ||
612 | $msg ||= ''; | ||
613 | if ($msg ne '') { | ||
614 | $msg = ' ' . escape_html($msg); | ||
615 | } | ||
616 | my $img; | ||
617 | my $alt; | ||
618 | my $title; | ||
619 | if ($phase == 0) { | ||
620 | if ($Options{pngs}) { | ||
621 | $img = smoosh($Options{imgbase}, 'newmoon.png'); | ||
622 | } else { | ||
623 | $img = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAGQAAABkABchkaRQAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAC6SURBVDiNpdNNbsIwFATgL0HKolchHKBX6yFaBOEyoPYUabvOIVKJRaCL2JX5TRNGGvnJ8ozGz89cYoElPvET+BX2yivn/1Bggw5HHMKa1h2qcPZC/JEIhvh+brIZIY6sorhMYo9hh3KGFzzfa84NZNjDt9OG/ZcH1BlaPE1IAG0+URhxzNGESKPFaHJs9Q0Ziww7HnvGeXSrJhis0jiFfjwnj3I0WRv+TKtr4hQl3lDrZ6QN9Wt654hfWfGDmBpUwDkAAAAASUVORK5CYII='; | ||
624 | } | ||
625 | $title = 'New Moon'; | ||
626 | $alt = 'new'; | ||
627 | } elsif ($phase == 1) { | ||
628 | if ($Options{pngs}) { | ||
629 | $img = smoosh($Options{imgbase}, 'firstquarter.png'); | ||
630 | } else { | ||
631 | $img = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAGQAAABkABchkaRQAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAADfSURBVDiNndM9TsNAFATgzy5yjZSAE85JBygETgENUPF3iBCitHAFQkcIhZ/Ryn9gRlrZmp2Z3ef3TBOHOMULPrDBMrhpi/4HI5xjix2+4nmJRbx/Yh7ahvkpRPVV4QDXwT3UQy46zGkAZDgK/iytefvHgCrkJsqZUH6cLnNbABSxd5Jhhf1IbkMXv8Qux7hH1Ic1xvk/jBWy6gavumvtwx7ectwZXkKh7MA95XgObeOtpI2U4zl0kGbpxgiPvwQUcXLrKFchc82f6Ur0PK49azOnmOI4TBu84zm4SV38DeIVYkrYJyNbAAAAAElFTkSuQmCC'; | ||
632 | } | ||
633 | $title = 'First Quarter'; | ||
634 | $alt = '1st'; | ||
635 | } elsif ($phase == 2) { | ||
636 | if ($Options{pngs}) { | ||
637 | $img = smoosh($Options{imgbase}, 'fullmoon.png'); | ||
638 | } else { | ||
639 | $img = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAGQAAABkABchkaRQAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAADlSURBVDiNrdNBUsJAEAXQlyw4hq4hwWPqTixET6ELkZ16CcAq7oFLqXExjaYgQVNlV/Viev7/6XT/4TjGuME7PiLXUatb8N8xwB12SFjiIXIZtU/MAntEfgvQE4YtHxhiHpjXQ5H7uLhEcaLLAleBvd0Xx9Ha/BdyU+Q5OBV5OKmj7a4YBWdSyNPe4aKHAHkzqcQZNj3JgnNexqE8heyIAulffuFF3kTfIVbBVeu/xoXGGsn2TLJJ/mqkafNiINszySYZdbS90GHlvcgsWktY4TFy7ecxTdvIzahxHQLbyFXUqkPwF2ASRNYgB/PXAAAAAElFTkSuQmCC'; | ||
640 | } | ||
641 | $alt = 'full'; | ||
642 | $title = 'Full Moon'; | ||
643 | } else { | ||
644 | if ($Options{pngs}) { | ||
645 | $img = smoosh($Options{imgbase}, 'lastquarter.png'); | ||
646 | } else { | ||
647 | $img = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAGQAAABkABchkaRQAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAADmSURBVDiNndMxTsNAEIXhzy5yCyQ6FAgcE7oQheQWUAAl5BIkREoZrgB0GFNkHBl7bURGsryaee/3jHeXdpxjghU+8InXyI0S+n0MMEeBEi+4jfV3vAvMQtsyL0J0j2GtViaeRRMyj8IlsgY8BSijE2Kur/hy09wHKMJrEolhwtwHKDHOsI4OLnoAXfl1jiNsOkR9keE4P8D4q4scbzg5xIxtjie709f1E7siC+9+Gx/8fxvPKtEsklcJSBdgWhcN8ByFR5z+AWgd5QpyE+OUWOJO+zJNU+Z6jHAdgHe7K73CuD5zFT9nCmRDIssCaAAAAABJRU5ErkJggg=='; | ||
648 | } | ||
649 | $alt = 'last'; | ||
650 | $title = 'Last Quarter'; | ||
651 | } | ||
652 | if ($Options{nostyle}) { | ||
653 | print("<div style=\"float: left\"><img border=\"0\" width=\"16\" height=\"16\" alt=\"$alt\" title=\"$title\" src=\"$img\">$msg</div>"); | ||
654 | } else { | ||
655 | print("<div class=\"rem-moon\"><img width=\"16\" height=\"16\" alt=\"$alt\" title=\"$title\" src=\"$img\">$msg</div>"); | ||
656 | } | ||
657 | } | ||
658 | |||
659 | if ($Options{nostyle}) { | ||
660 | print "<div style=\"float: right\">$day$week</div>\n"; | ||
661 | print "<p> </p>\n"; | ||
662 | } else { | ||
663 | print "<div class=\"rem-daynumber\">$day$week</div>\n"; | ||
664 | } | ||
665 | if ($days->[$day]) { | ||
666 | print(join("\n", @{$days->[$day]})); | ||
667 | } | ||
668 | |||
669 | print "</td>\n"; | ||
670 | } | ||
671 | |||
672 | sub escape_html | ||
673 | { | ||
674 | my($in) = @_; | ||
675 | $in =~ s/\&/\&/g; | ||
676 | $in =~ s/\</\</g; | ||
677 | $in =~ s/\>/\>/g; | ||
678 | return $in; | ||
679 | } | ||
680 | |||
681 | parse_options(); | ||
682 | if ($Options{help}) { | ||
683 | usage(0); | ||
684 | exit(0); | ||
685 | } elsif ($Options{man}) { | ||
686 | system("perldoc $0"); | ||
687 | exit(0); | ||
688 | } elsif ($Options{version}) { | ||
689 | print "rem2html version $rem2html_version.\n"; | ||
690 | exit(0); | ||
691 | } | ||
692 | |||
693 | if (-t STDIN) { ## no critic | ||
694 | print STDERR "$TIDY_PROGNAME: Input should not come from a terminal.\n\n"; | ||
695 | usage(1); | ||
696 | } | ||
697 | |||
698 | my $found_something = 0; | ||
699 | while(1) { | ||
700 | last if (!parse_input()); | ||
701 | start_output() unless $found_something; | ||
702 | $found_something = 1; | ||
703 | output_calendar(); | ||
704 | } | ||
705 | if ($found_something) { | ||
706 | end_output(); | ||
707 | exit(0); | ||
708 | } else { | ||
709 | print STDERR "$TIDY_PROGNAME: Could not find any calendar data on STDIN.\n"; | ||
710 | exit(1); | ||
711 | } | ||
712 | |||
713 | sub default_stylesheet | ||
714 | { | ||
715 | return <<'EOF'; | ||
716 | table.rem-cal { | ||
717 | font-family: helvetica, arial, sans-serif; | ||
718 | font-size: 12pt; | ||
719 | } | ||
720 | |||
721 | table.rem-sc-table { | ||
722 | font-family: helvetica, arial, sans-serif; | ||
723 | font-size: 10pt; | ||
724 | width: 95%; | ||
725 | float: left; | ||
726 | } | ||
727 | |||
728 | caption.rem-cal-caption { | ||
729 | font-size: 14pt; | ||
730 | font-weight: bold; | ||
731 | } | ||
732 | |||
733 | th.rem-cal-hdr { | ||
734 | width: 14%; | ||
735 | border-style: solid; | ||
736 | border-width: 1px; | ||
737 | vertical-align: top; | ||
738 | } | ||
739 | td.rem-empty, td.rem-cell, td.rem-small-calendar { | ||
740 | width: 14%; | ||
741 | height: 7em; | ||
742 | border-style: solid; | ||
743 | border-width: 1px; | ||
744 | vertical-align: top; | ||
745 | } | ||
746 | td.rem-today { | ||
747 | width: 14%; | ||
748 | height: 7em; | ||
749 | border-style: solid; | ||
750 | border-width: 2px; | ||
751 | border-color: #EE3333; | ||
752 | vertical-align: top; | ||
753 | } | ||
754 | |||
755 | table.rem-cal { | ||
756 | width: 100%; | ||
757 | border-collapse: collapse; | ||
758 | } | ||
759 | |||
760 | div.rem-daynumber { | ||
761 | float: right; | ||
762 | text-align: right; | ||
763 | vertical-align: top; | ||
764 | font-size: 14pt; | ||
765 | } | ||
766 | |||
767 | p.rem-entry { | ||
768 | clear: both; | ||
769 | } | ||
770 | |||
771 | div.rem-moon { | ||
772 | float: left; | ||
773 | text-align: left; | ||
774 | vertical-align: top; | ||
775 | } | ||
776 | |||
777 | th.rem-sc-hdr { | ||
778 | text-align: right; | ||
779 | } | ||
780 | |||
781 | td.rem-sc-empty-cell, td.rem-sc-cell { | ||
782 | text-align: right; | ||
783 | width: 14%; | ||
784 | } | ||
785 | |||
786 | caption.rem-sc-caption { | ||
787 | font-size: 12pt; | ||
788 | } | ||
789 | EOF | ||
790 | } | ||
diff --git a/.local/bin/sentences b/.local/bin/sentences index cd90380..750072e 100755 --- a/.local/bin/sentences +++ b/.local/bin/sentences | |||
@@ -3,7 +3,7 @@ | |||
3 | use strict; | 3 | use strict; |
4 | 4 | ||
5 | my $pont = qr{[.!?]+}; ## punctuation | 5 | my $pont = qr{[.!?]+}; ## punctuation |
6 | my $abrev = qr{\b(?:Pr|Dr|Mr|[A-Z]|i\.e|e\.g|et al|etc)\.}; ## abbreviations | 6 | my $abrev = qr{\b(?:Pr|Dr|Mr|[A-Z]|i\.e|e\.g|et al|etc|p|Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec|vs)\.}; ## abbreviations |
7 | my $header = qr{(=+ .*? =+)}; | 7 | my $header = qr{(=+ .*? =+)}; |
8 | 8 | ||
9 | $/ = ""; | 9 | $/ = ""; |
diff --git a/.local/bin/yc b/.local/bin/yc index 3acfbcb..22ab872 100755 --- a/.local/bin/yc +++ b/.local/bin/yc | |||
@@ -3,6 +3,6 @@ | |||
3 | SCOPE=$(gum input --placeholder "scope") | 3 | SCOPE=$(gum input --placeholder "scope") |
4 | 4 | ||
5 | SUMMARY=$(gum input --value "$SCOPE: " --placeholder "summary of this change") | 5 | SUMMARY=$(gum input --value "$SCOPE: " --placeholder "summary of this change") |
6 | DESCRIPTION=$(gum write --placeholder "details of this change (<C-d> to finish)") | 6 | DESCRIPTION=$(gum write --placeholder "details of this change") |
7 | 7 | ||
8 | gum confirm "commit changes?" && yadm commit -m "$SUMMARY" -m "$DESCRIPTION" | 8 | gum confirm "commit changes?" && yadm commit -m "$SUMMARY" -m "$DESCRIPTION" |
diff --git a/.local/share/yadm/archive b/.local/share/yadm/archive index 8a69601..70f9c45 100644 --- a/.local/share/yadm/archive +++ b/.local/share/yadm/archive | |||
Binary files differ | |||
diff --git a/desk/landing/html_remind/calendar.css b/desk/landing/html_remind/calendar.css new file mode 100644 index 0000000..d9cf58f --- /dev/null +++ b/desk/landing/html_remind/calendar.css | |||
@@ -0,0 +1,81 @@ | |||
1 | body { | ||
2 | color: #cdd6f4; | ||
3 | background-color: #1e1e2e; | ||
4 | line-height: 1.4; | ||
5 | max-width: 1200px; | ||
6 | margin: 20px auto; | ||
7 | padding: 0 10px; | ||
8 | word-wrap: break-word; | ||
9 | } | ||
10 | |||
11 | table.rem-cal { | ||
12 | font-size: 12pt; | ||
13 | } | ||
14 | |||
15 | table.rem-sc-table { | ||
16 | font-size: 10pt; | ||
17 | width: 95%; | ||
18 | float: left; | ||
19 | } | ||
20 | |||
21 | caption.rem-cal-caption { | ||
22 | font-size: 14pt; | ||
23 | font-weight: bold; | ||
24 | } | ||
25 | |||
26 | th.rem-cal-hdr { | ||
27 | width: 14%; | ||
28 | border-style: solid; | ||
29 | border-width: 1px; | ||
30 | vertical-align: top; | ||
31 | } | ||
32 | td.rem-empty, td.rem-cell, td.rem-small-calendar { | ||
33 | width: 14%; | ||
34 | height: 7em; | ||
35 | border-style: solid; | ||
36 | border-width: 1px; | ||
37 | vertical-align: top; | ||
38 | } | ||
39 | td.rem-today { | ||
40 | width: 14%; | ||
41 | height: 7em; | ||
42 | border-style: solid; | ||
43 | border-width: 2px; | ||
44 | border-color: #EE3333; | ||
45 | vertical-align: top; | ||
46 | } | ||
47 | |||
48 | table.rem-cal { | ||
49 | width: 100%; | ||
50 | border-collapse: collapse; | ||
51 | } | ||
52 | |||
53 | div.rem-daynumber { | ||
54 | float: right; | ||
55 | text-align: right; | ||
56 | vertical-align: top; | ||
57 | font-size: 14pt; | ||
58 | } | ||
59 | |||
60 | p.rem-entry { | ||
61 | clear: both; | ||
62 | } | ||
63 | |||
64 | div.rem-moon { | ||
65 | float: left; | ||
66 | text-align: left; | ||
67 | vertical-align: top; | ||
68 | } | ||
69 | |||
70 | th.rem-sc-hdr { | ||
71 | text-align: right; | ||
72 | } | ||
73 | |||
74 | td.rem-sc-empty-cell, td.rem-sc-cell { | ||
75 | text-align: right; | ||
76 | width: 14%; | ||
77 | } | ||
78 | |||
79 | caption.rem-sc-caption { | ||
80 | font-size: 12pt; | ||
81 | } | ||