diff options
Diffstat (limited to '.config/hypr')
| -rw-r--r-- | .config/hypr/conf/autostart.conf | 39 | ||||
| -rw-r--r-- | .config/hypr/conf/gestures.conf | 2 | ||||
| -rw-r--r-- | .config/hypr/conf/keybinds.conf | 96 | ||||
| -rw-r--r-- | .config/hypr/conf/monitor.conf | 5 | ||||
| -rw-r--r-- | .config/hypr/conf/sound_brightness_notifications.conf | 9 | ||||
| -rw-r--r-- | .config/hypr/conf/windowrules.conf | 81 | ||||
| -rw-r--r-- | .config/hypr/hyprland.conf | 122 | ||||
| -rw-r--r-- | .config/hypr/hyprlock.conf | 88 | ||||
| -rw-r--r-- | .config/hypr/hyprpaper.conf | 5 | ||||
| -rw-r--r-- | .config/hypr/hyprshade.toml | 4 | ||||
| -rw-r--r-- | .config/hypr/mocha.conf | 77 | ||||
| -rwxr-xr-x | .config/hypr/scripts/switch.sh | 10 | ||||
| -rw-r--r-- | .config/hypr/shaders/chromatic_abberation.frag | 24 | ||||
| -rw-r--r-- | .config/hypr/shaders/crt.frag | 511 | ||||
| -rw-r--r-- | .config/hypr/shaders/drugs.frag | 42 | ||||
| -rw-r--r-- | .config/hypr/shaders/extradark.frag | 21 | ||||
| -rw-r--r-- | .config/hypr/shaders/invert.frag | 13 | ||||
| -rw-r--r-- | .config/hypr/shaders/solarized.frag | 41 | 
18 files changed, 1190 insertions, 0 deletions
| 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/gestures.conf b/.config/hypr/conf/gestures.conf new file mode 100644 index 0000000..ac2ade3 --- /dev/null +++ b/.config/hypr/conf/gestures.conf | |||
| @@ -0,0 +1,2 @@ | |||
| 1 | gesture = 3, horizontal, workspace | ||
| 2 | gesture = 3, vertical, fullscreen | ||
| diff --git a/.config/hypr/conf/keybinds.conf b/.config/hypr/conf/keybinds.conf new file mode 100644 index 0000000..ecb142c --- /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 = foot | ||
| 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 show # ins | ||
| 14 | bind = $mainMod, 0, exec, swaync-client --hide-latest | ||
| 15 | bind = $mainMod+SHIFT, 0, exec, swaync-client -t | ||
| 16 | bindr = $mainMod+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 | # Colour picker | ||
| 33 | # https://wimpysworld.com/posts/fuzzel-hyprpicker/ | ||
| 34 | bind = $mainMod, code:32, exec, $HOME/.local/bin/fuzzel_hyprpicker.sh | ||
| 35 | |||
| 36 | # Screenshots: | ||
| 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..de07cbe --- /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 | ||
| 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..ab0676b --- /dev/null +++ b/.config/hypr/conf/windowrules.conf | |||
| @@ -0,0 +1,81 @@ | |||
| 1 | # See https://wiki.hyprland.org/Configuring/Window-Rules/ | ||
| 2 | windowrule = suppressevent maximize, class:.* | ||
| 3 | |||
| 4 | # polkit auth agent | ||
| 5 | windowrule = float, class:org.kde.polkit-kde-authentication-agent-1 | ||
| 6 | |||
| 7 | # yad | ||
| 8 | windowrule = float, class:yad | ||
| 9 | |||
| 10 | # Libre Office | ||
| 11 | windowrule = size 800 600, class:soffice,title:Export | ||
| 12 | |||
| 13 | # Blueman | ||
| 14 | windowrule = float,class:^(blueman-manager)$ | ||
| 15 | |||
| 16 | # NetworkManager | ||
| 17 | windowrule = float,class:^(nm-connection-editor)$ | ||
| 18 | |||
| 19 | # Pavucontrol | ||
| 20 | windowrule = float,class:^(org.pulseaudio.pavucontrol)$ | ||
| 21 | windowrule = size 800 600,class:^(org.pulseaudio.pavucontrol)$ | ||
| 22 | |||
| 23 | # copyq | ||
| 24 | windowrule = float, class:com.github.hluk.copyq | ||
| 25 | windowrule = noborder, class:com.github.hluk.copyq | ||
| 26 | windowrule = noblur, class:com.github.hluk.copyq | ||
| 27 | windowrule = dimaround, class:com.github.hluk.copyq | ||
| 28 | windowrule = move 55% 15%, class:com.github.hluk.copyq | ||
| 29 | windowrule = size 35% 65%, class:com.github.hluk.copyq | ||
| 30 | |||
| 31 | # Firefox | ||
| 32 | windowrule = workspace name:browser silent, class:firefox | ||
| 33 | |||
| 34 | # Browser Picture in Picture | ||
| 35 | windowrule = float, title:^(Picture-in-Picture)$ | ||
| 36 | windowrule = pin, title:^(Picture-in-Picture)$ | ||
| 37 | windowrule = move 72% 40%, title:^(Picture-in-Picture)$ | ||
| 38 | windowrule = size 520 390, title:^(Picture-in-Picture)$ | ||
| 39 | |||
| 40 | # Discord Popout | ||
| 41 | windowrule = float, title:^(Discord Popout)$ | ||
| 42 | windowrule = pin, title:^(Discord Popout)$ | ||
| 43 | windowrule = move 72% 40%, title:^(Discord Popout)$ | ||
| 44 | windowrule = size 573 354, title:^(Discord Popout)$ | ||
| 45 | |||
| 46 | # Xwaylandvideobridge | ||
| 47 | windowrule = opacity 0.0 override,class:^(xwaylandvideobridge)$ | ||
| 48 | windowrule = noanim,class:^(xwaylandvideobridge)$ | ||
| 49 | windowrule = noinitialfocus,class:^(xwaylandvideobridge)$ | ||
| 50 | windowrule = maxsize 1 1,class:^(xwaylandvideobridge)$ | ||
| 51 | windowrule = noblur,class:^(xwaylandvideobridge)$ | ||
| 52 | |||
| 53 | # Zotero | ||
| 54 | windowrule = workspace name:zotero silent, class:Zotero | ||
| 55 | |||
| 56 | windowrule = float, class:^(Zotero)$,title:^(Progress)$ | ||
| 57 | windowrule = noinitialfocus, class:^(Zotero)$,title:^(Progress)$ | ||
| 58 | windowrule = move 1579 954, class:^(Zotero)$,title:^(Progress)$ | ||
| 59 | windowrule = size 300 72, class:^(Zotero)$,title:^(Progress)$ | ||
| 60 | windowrule = size 445 195, class:^(Zotero)$,title:^(New Collection)$ | ||
| 61 | |||
| 62 | # Thunar | ||
| 63 | windowrule = float, class:^(Thunar)$,title:^(File Operation Progress)$ | ||
| 64 | windowrule = noinitialfocus, class:^(Thunar)$,title:^(File Operation Progress)$ | ||
| 65 | windowrule = size 505 100, class:^(Thunar)$,title:^(File Operation Progress)$ | ||
| 66 | windowrule = float, class:^(Thunar)$,title:^(Rename).*$ | ||
| 67 | |||
| 68 | # engrampa | ||
| 69 | windowrule = float, class:^(engrampa)$,title:^(Extract archive)$ | ||
| 70 | |||
| 71 | # Spotify | ||
| 72 | windowrule = workspace name:music silent, class:^(Spotify)$ | ||
| 73 | |||
| 74 | # Thunderbird | ||
| 75 | windowrule = float, class:^(thunderbird)$,title:^(Edit Item)$ | ||
| 76 | windowrule = size 720 790, class:^(thunderbird)$,title:^(Edit Item)$ | ||
| 77 | windowrule = float, class:^(thunderbird)$,title:^(TbSync account manager)$ | ||
| 78 | windowrule = size 1100 880, class:^(thunderbird)$,title:^(Edit Item)$ | ||
| 79 | |||
| 80 | # Zoom | ||
| 81 | windowrule=stayfocused,class:(zoom),initialTitle:(menu window) | ||
| diff --git a/.config/hypr/hyprland.conf b/.config/hypr/hyprland.conf new file mode 100644 index 0000000..329117c --- /dev/null +++ b/.config/hypr/hyprland.conf | |||
| @@ -0,0 +1,122 @@ | |||
| 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 | source = ~/.config/hypr/conf/gestures.conf | ||
| 15 | |||
| 16 | # Some default env vars. | ||
| 17 | env = GDK_BACKEND,wayland,x11,* | ||
| 18 | env = QT_QPA_PLATFORM,wayland;xcb | ||
| 19 | env = CLUTTER_BACKEND,wayland | ||
| 20 | env = XDG_CURRENT_DESKTOP,Hyprland | ||
| 21 | env = XDG_SESSION_TYPE,wayland | ||
| 22 | env = XDG_SESSION_DESKTOP,Hyprland | ||
| 23 | |||
| 24 | env = QT_AUTO_SCREEN_SCALE_FACTOR,1 - (From the Qt documentation) enables automatic scaling, based on the monitor’s pixel density | ||
| 25 | env = QT_QPA_PLATFORM,wayland;xcb - Tell Qt applications to use the Wayland backend, and fall back to x11 if Wayland is unavailable | ||
| 26 | env = QT_WAYLAND_DISABLE_WINDOWDECORATION,1 - Disables window decorations on Qt applications | ||
| 27 | env = QT_QPA_PLATFORMTHEME,qt5ct - Tells Qt based applications to pick your theme from qt5ct, use with Kvantum. | ||
| 28 | |||
| 29 | env = XCURSOR_SIZE,24 | ||
| 30 | env = QT_QPA_PLATFORMTHEME,qt6ct # change to qt6ct if you have that | ||
| 31 | env = SEMESTER_THEME,you got this | ||
| 32 | |||
| 33 | # For all categories, see https://wiki.hyprland.org/Configuring/Variables/ | ||
| 34 | input { | ||
| 35 | kb_layout = us,tr | ||
| 36 | kb_variant = colemak, | ||
| 37 | kb_model = | ||
| 38 | kb_options = grp:alt_shift_toggle | ||
| 39 | kb_rules = | ||
| 40 | numlock_by_default = true | ||
| 41 | |||
| 42 | follow_mouse = 1 | ||
| 43 | |||
| 44 | touchpad { | ||
| 45 | natural_scroll = true | ||
| 46 | } | ||
| 47 | |||
| 48 | sensitivity = 0 # -1.0 - 1.0, 0 means no modification. | ||
| 49 | } | ||
| 50 | |||
| 51 | general { | ||
| 52 | # See https://wiki.hyprland.org/Configuring/Variables/ | ||
| 53 | |||
| 54 | gaps_in = 3 | ||
| 55 | gaps_out = 6 | ||
| 56 | border_size = 2 | ||
| 57 | col.active_border = rgba(33ccffee) rgba(00ff99ee) 45deg | ||
| 58 | col.inactive_border = rgba(595959aa) | ||
| 59 | |||
| 60 | layout = dwindle | ||
| 61 | |||
| 62 | # Please see https://wiki.hyprland.org/Configuring/Tearing/ before you turn this on | ||
| 63 | allow_tearing = false | ||
| 64 | } | ||
| 65 | |||
| 66 | decoration { | ||
| 67 | # See https://wiki.hyprland.org/Configuring/Variables/ | ||
| 68 | |||
| 69 | rounding = 0 | ||
| 70 | |||
| 71 | blur { | ||
| 72 | enabled = true | ||
| 73 | size = 20 | ||
| 74 | passes = 1 | ||
| 75 | } | ||
| 76 | |||
| 77 | shadow { | ||
| 78 | enabled = true | ||
| 79 | range = 4 | ||
| 80 | render_power = 3 | ||
| 81 | color = rgba(1a1a1aee) | ||
| 82 | } | ||
| 83 | } | ||
| 84 | |||
| 85 | animations { | ||
| 86 | enabled = yes | ||
| 87 | |||
| 88 | # Some default animations, see https://wiki.hyprland.org/Configuring/Animations/ | ||
| 89 | |||
| 90 | bezier = myBezier, 0.05, 0.9, 0.1, 1.05 | ||
| 91 | |||
| 92 | animation = windows, 1, 7, myBezier | ||
| 93 | animation = windowsOut, 1, 7, default, popin 80% | ||
| 94 | animation = border, 1, 10, default | ||
| 95 | animation = borderangle, 1, 8, default | ||
| 96 | animation = fade, 1, 7, default | ||
| 97 | animation = workspaces, 1, 6, default | ||
| 98 | } | ||
| 99 | |||
| 100 | dwindle { | ||
| 101 | # See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ | ||
| 102 | pseudotile = yes # master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below | ||
| 103 | preserve_split = yes # you probably want this | ||
| 104 | } | ||
| 105 | |||
| 106 | master { | ||
| 107 | # See https://wiki.hyprland.org/Configuring/Master-Layout/ | ||
| 108 | new_status = master | ||
| 109 | } | ||
| 110 | |||
| 111 | misc { | ||
| 112 | # See https://wiki.hyprland.org/Configuring/Variables/ | ||
| 113 | force_default_wallpaper = 0 # Set to 0 or 1 to disable the anime mascot wallpapers | ||
| 114 | enable_anr_dialog = false | ||
| 115 | } | ||
| 116 | |||
| 117 | binds { | ||
| 118 | workspace_back_and_forth = true | ||
| 119 | } | ||
| 120 | |||
| 121 | |||
| 122 | 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 | } | ||
