From 7ed5898038ad7b2a2562d644e49a7e602f1575f2 Mon Sep 17 00:00:00 2001 From: Win Date: Sun, 1 Sep 2024 17:29:01 +0700 Subject: [PATCH] Added hypr and waybar --- {.config/foot => foot}/foot.ini | 0 {.config/fuzzel => fuzzel}/fuzzel.ini | 0 hypr/hyprland.conf | 215 ++++++++++++++++++ {.config/micro => micro}/bindings.json | 0 {.config/micro => micro}/buffers/history | Bin .../colorschemes/monokai-dark.micro | 0 .../plug/detectindent/README.md | 0 .../plug/detectindent/detectindent.lua | 0 .../plug/detectindent/help/detectindent.md | 0 .../plug/detectindent/repo.json | 0 .../plug/filemanager/.editorconfig | 0 .../plug/filemanager/CHANGELOG.md | 0 .../micro => micro}/plug/filemanager/LICENSE | 0 .../plug/filemanager/README.md | 0 .../plug/filemanager/example.jpg | Bin .../plug/filemanager/filemanager.lua | 0 .../plug/filemanager/repo.json | 0 .../plug/filemanager/syntax.yaml | 0 {.config/micro => micro}/settings.json | 0 {.config/micro => micro}/syntax/asm.yaml | 0 {.config/sway => sway}/config | 0 waybar/config | 181 +++++++++++++++ waybar/style.css | 194 ++++++++++++++++ 23 files changed, 590 insertions(+) rename {.config/foot => foot}/foot.ini (100%) rename {.config/fuzzel => fuzzel}/fuzzel.ini (100%) create mode 100644 hypr/hyprland.conf rename {.config/micro => micro}/bindings.json (100%) rename {.config/micro => micro}/buffers/history (100%) rename {.config/micro => micro}/colorschemes/monokai-dark.micro (100%) rename {.config/micro => micro}/plug/detectindent/README.md (100%) rename {.config/micro => micro}/plug/detectindent/detectindent.lua (100%) rename {.config/micro => micro}/plug/detectindent/help/detectindent.md (100%) rename {.config/micro => micro}/plug/detectindent/repo.json (100%) rename {.config/micro => micro}/plug/filemanager/.editorconfig (100%) rename {.config/micro => micro}/plug/filemanager/CHANGELOG.md (100%) rename {.config/micro => micro}/plug/filemanager/LICENSE (100%) rename {.config/micro => micro}/plug/filemanager/README.md (100%) rename {.config/micro => micro}/plug/filemanager/example.jpg (100%) rename {.config/micro => micro}/plug/filemanager/filemanager.lua (100%) rename {.config/micro => micro}/plug/filemanager/repo.json (100%) rename {.config/micro => micro}/plug/filemanager/syntax.yaml (100%) rename {.config/micro => micro}/settings.json (100%) rename {.config/micro => micro}/syntax/asm.yaml (100%) rename {.config/sway => sway}/config (100%) create mode 100644 waybar/config create mode 100644 waybar/style.css diff --git a/.config/foot/foot.ini b/foot/foot.ini similarity index 100% rename from .config/foot/foot.ini rename to foot/foot.ini diff --git a/.config/fuzzel/fuzzel.ini b/fuzzel/fuzzel.ini similarity index 100% rename from .config/fuzzel/fuzzel.ini rename to fuzzel/fuzzel.ini diff --git a/hypr/hyprland.conf b/hypr/hyprland.conf new file mode 100644 index 0000000..67b85ab --- /dev/null +++ b/hypr/hyprland.conf @@ -0,0 +1,215 @@ +# ####################################################################################### +# AUTOGENERATED HYPR CONFIG. +# PLEASE USE THE CONFIG PROVIDED IN THE GIT REPO /examples/hypr.conf AND EDIT IT, +# OR EDIT THIS ONE ACCORDING TO THE WIKI INSTRUCTIONS. +# ####################################################################################### + +# +# Please note not all available settings / options are set here. +# For a full list, see the wiki +# + +autogenerated = 0 # remove this line to remove the warning + +# See https://wiki.hyprland.org/Configuring/Monitors/ +monitor=,preferred,auto,1 + +# See https://wiki.hyprland.org/Configuring/Keywords/ for more + +# Execute your favorite apps at launch +# exec-once = waybar & hyprpaper & firefox +exec-once = swaybg -i /home/slimbook/Pictures/wallpaper.webp +exec-once = waybar + +# Source a file (multi-file configs) +# source = ~/.config/hypr/myColors.conf + +# Set programs that you use +$terminal = foot +$fileManager = nautilus +$menu = fuzzel + +# Some default env vars. +env = XCURSOR_SIZE,24 +env = QT_QPA_PLATFORMTHEME,qt5ct # change to qt6ct if you have that + +# For all categories, see https://wiki.hyprland.org/Configuring/Variables/ +input { + kb_layout = us,th + kb_variant = + kb_model = + kb_options = grp:win_space_toggle + kb_rules = + + follow_mouse = 1 + + touchpad { + natural_scroll = yes + } + + sensitivity = 0 # -1.0 to 1.0, 0 means no modification. +} + +general { + # See https://wiki.hyprland.org/Configuring/Variables/ for more + + gaps_in = 2 + gaps_out = 5 + border_size = 1 + # col.active_border = rgba(33ccffee) rgba(00ff99ee) 45deg + col.active_border = rgba(ffffffff) + col.inactive_border = rgba(595959aa) + + layout = dwindle + + # Please see https://wiki.hyprland.org/Configuring/Tearing/ before you turn this on + allow_tearing = false +} + +decoration { + # See https://wiki.hyprland.org/Configuring/Variables/ for more + + rounding = 10 + + blur { + enabled = true + size = 3 + passes = 1 + } + + drop_shadow = yes + shadow_range = 4 + shadow_render_power = 3 + col.shadow = rgba(1a1a1aee) +} + +animations { + enabled = yes + + # Some default animations, see https://wiki.hyprland.org/Configuring/Animations/ for more + + bezier = myBezier, 0.05, 0.9, 0.1, 1.05 + + animation = windows, 1, 7, myBezier + animation = windowsOut, 1, 7, default, popin 80% + animation = border, 1, 10, default + animation = borderangle, 1, 8, default + animation = fade, 1, 7, default + animation = workspaces, 1, 6, default +} + +dwindle { + # See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more + pseudotile = yes # master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below + preserve_split = yes # you probably want this +} + +master { + # See https://wiki.hyprland.org/Configuring/Master-Layout/ for more + new_is_master = true +} + +gestures { + # See https://wiki.hyprland.org/Configuring/Variables/ for more + workspace_swipe = on +} + +misc { + # See https://wiki.hyprland.org/Configuring/Variables/ for more + force_default_wallpaper = 0 # Set to 0 or 1 to disable the anime mascot wallpapers + disable_splash_rendering = true + disable_hyprland_logo = true +} + +# Example per-device config +# See https://wiki.hyprland.org/Configuring/Keywords/#per-device-input-configs for more +device { + name = epic-mouse-v1 + sensitivity = -0.5 +} + +# Example windowrule v1 +# windowrule = float, ^(kitty)$ +# Example windowrule v2 +# windowrulev2 = float,class:^(kitty)$,title:^(kitty)$ +# See https://wiki.hyprland.org/Configuring/Window-Rules/ for more +windowrulev2 = suppressevent maximize, class:.* # You'll probably like this. + + +# See https://wiki.hyprland.org/Configuring/Keywords/ for more +$mainMod = SUPER + +# Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more +bind = $mainMod, Return, exec, $terminal +bind = $mainMod SHIFT, Q, killactive, +bind = $mainMod, M, exit, +bind = $mainMod, E, exec, $fileManager +bind = $mainMod, V, togglefloating, +bind = $mainMod, D, exec, $menu +bind = $mainMod, P, pseudo, # dwindle +bind = $mainMod, J, togglesplit, # dwindle + +# Move focus with mainMod + arrow keys +bind = $mainMod, left, movefocus, l +bind = $mainMod, right, movefocus, r +bind = $mainMod, up, movefocus, u +bind = $mainMod, down, movefocus, d + +bind = $mainMod SHIFT, right, movewindow, r +bind = $mainMod SHIFT, left, movewindow, l +bind = $mainMod SHIFT, up, movewindow, u +bind = $mainMod SHIFT, down, movewindow, d + +bind = $mainMod ALT, right, resizeactive, 10 0 +bind = $mainMod ALT, left, resizeactive, -10 0 +bind = $mainMod ALT, up, resizeactive, 0 -10 +bind = $mainMod ALT, down, resizeactive, 0 10 + +# Switch workspaces with mainMod + [0-9] +bind = $mainMod, 1, workspace, 1 +bind = $mainMod, 2, workspace, 2 +bind = $mainMod, 3, workspace, 3 +bind = $mainMod, 4, workspace, 4 +bind = $mainMod, 5, workspace, 5 +bind = $mainMod, 6, workspace, 6 +bind = $mainMod, 7, workspace, 7 +bind = $mainMod, 8, workspace, 8 +bind = $mainMod, 9, workspace, 9 +bind = $mainMod, 0, workspace, 10 + +# Move active window to a workspace with mainMod + SHIFT + [0-9] +bind = $mainMod SHIFT, 1, movetoworkspace, 1 +bind = $mainMod SHIFT, 2, movetoworkspace, 2 +bind = $mainMod SHIFT, 3, movetoworkspace, 3 +bind = $mainMod SHIFT, 4, movetoworkspace, 4 +bind = $mainMod SHIFT, 5, movetoworkspace, 5 +bind = $mainMod SHIFT, 6, movetoworkspace, 6 +bind = $mainMod SHIFT, 7, movetoworkspace, 7 +bind = $mainMod SHIFT, 8, movetoworkspace, 8 +bind = $mainMod SHIFT, 9, movetoworkspace, 9 +bind = $mainMod SHIFT, 0, movetoworkspace, 10 + +# Example special workspace (scratchpad) +bind = $mainMod, S, togglespecialworkspace, magic +bind = $mainMod SHIFT, S, movetoworkspace, special:magic + +# Scroll through existing workspaces with mainMod + scroll +bind = $mainMod, mouse_down, workspace, e+1 +bind = $mainMod, mouse_up, workspace, e-1 + +# Move/resize windows with mainMod + LMB/RMB and dragging +bindm = $mainMod, mouse:272, movewindow +bindm = $mainMod, mouse:273, resizewindow + +# Volume +binde =, XF86AudioRaiseVolume, exec, wpctl set-volume -l 1.5 @DEFAULT_AUDIO_SINK@ 5%+ +binde =, XF86AudioLowerVolume, exec, wpctl set-volume -l 1.5 @DEFAULT_AUDIO_SINK@ 5%- +bind =, XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle + +# Screenshots +## Save To File + +## Clipboard +bind = $shiftMod, PRINT, exec, hyprshot -m output --clipboard-only +bind = $shiftMod ALT, PRINT, exec, hyprshot -m window --clipboard-only +bind = CTRL $shiftMod, PRINT, exec, hyprshot -m region --clipboard-only diff --git a/.config/micro/bindings.json b/micro/bindings.json similarity index 100% rename from .config/micro/bindings.json rename to micro/bindings.json diff --git a/.config/micro/buffers/history b/micro/buffers/history similarity index 100% rename from .config/micro/buffers/history rename to micro/buffers/history diff --git a/.config/micro/colorschemes/monokai-dark.micro b/micro/colorschemes/monokai-dark.micro similarity index 100% rename from .config/micro/colorschemes/monokai-dark.micro rename to micro/colorschemes/monokai-dark.micro diff --git a/.config/micro/plug/detectindent/README.md b/micro/plug/detectindent/README.md similarity index 100% rename from .config/micro/plug/detectindent/README.md rename to micro/plug/detectindent/README.md diff --git a/.config/micro/plug/detectindent/detectindent.lua b/micro/plug/detectindent/detectindent.lua similarity index 100% rename from .config/micro/plug/detectindent/detectindent.lua rename to micro/plug/detectindent/detectindent.lua diff --git a/.config/micro/plug/detectindent/help/detectindent.md b/micro/plug/detectindent/help/detectindent.md similarity index 100% rename from .config/micro/plug/detectindent/help/detectindent.md rename to micro/plug/detectindent/help/detectindent.md diff --git a/.config/micro/plug/detectindent/repo.json b/micro/plug/detectindent/repo.json similarity index 100% rename from .config/micro/plug/detectindent/repo.json rename to micro/plug/detectindent/repo.json diff --git a/.config/micro/plug/filemanager/.editorconfig b/micro/plug/filemanager/.editorconfig similarity index 100% rename from .config/micro/plug/filemanager/.editorconfig rename to micro/plug/filemanager/.editorconfig diff --git a/.config/micro/plug/filemanager/CHANGELOG.md b/micro/plug/filemanager/CHANGELOG.md similarity index 100% rename from .config/micro/plug/filemanager/CHANGELOG.md rename to micro/plug/filemanager/CHANGELOG.md diff --git a/.config/micro/plug/filemanager/LICENSE b/micro/plug/filemanager/LICENSE similarity index 100% rename from .config/micro/plug/filemanager/LICENSE rename to micro/plug/filemanager/LICENSE diff --git a/.config/micro/plug/filemanager/README.md b/micro/plug/filemanager/README.md similarity index 100% rename from .config/micro/plug/filemanager/README.md rename to micro/plug/filemanager/README.md diff --git a/.config/micro/plug/filemanager/example.jpg b/micro/plug/filemanager/example.jpg similarity index 100% rename from .config/micro/plug/filemanager/example.jpg rename to micro/plug/filemanager/example.jpg diff --git a/.config/micro/plug/filemanager/filemanager.lua b/micro/plug/filemanager/filemanager.lua similarity index 100% rename from .config/micro/plug/filemanager/filemanager.lua rename to micro/plug/filemanager/filemanager.lua diff --git a/.config/micro/plug/filemanager/repo.json b/micro/plug/filemanager/repo.json similarity index 100% rename from .config/micro/plug/filemanager/repo.json rename to micro/plug/filemanager/repo.json diff --git a/.config/micro/plug/filemanager/syntax.yaml b/micro/plug/filemanager/syntax.yaml similarity index 100% rename from .config/micro/plug/filemanager/syntax.yaml rename to micro/plug/filemanager/syntax.yaml diff --git a/.config/micro/settings.json b/micro/settings.json similarity index 100% rename from .config/micro/settings.json rename to micro/settings.json diff --git a/.config/micro/syntax/asm.yaml b/micro/syntax/asm.yaml similarity index 100% rename from .config/micro/syntax/asm.yaml rename to micro/syntax/asm.yaml diff --git a/.config/sway/config b/sway/config similarity index 100% rename from .config/sway/config rename to sway/config diff --git a/waybar/config b/waybar/config new file mode 100644 index 0000000..ef7cdd3 --- /dev/null +++ b/waybar/config @@ -0,0 +1,181 @@ +// ============================================================================= +// +// Waybar configuration +// +// Configuration reference: https://github.com/Alexays/Waybar/wiki/Configuration +// +// ============================================================================= + +{ + // ------------------------------------------------------------------------- + // Global configuration + // ------------------------------------------------------------------------- + + "layer": "top", + + "position": "top", + + // If height property would be not present, it'd be calculated dynamically + "height": 30, + + "modules-left": [ + "hyprland/workspaces", + "hyprland/mode" + ], + "modules-center": [ + "hyprland/window" + ], + "modules-right": [ + "network", + "memory", + "cpu", + "temperature", + "custom/keyboard-layout", + "battery", + "wireplumber", + "tray", + "clock#date", + "clock#time" + ], + + + // ------------------------------------------------------------------------- + // Modules + // ------------------------------------------------------------------------- + + "battery": { + "interval": 10, + "states": { + "warning": 30, + "critical": 15 + }, + // Connected to AC + "format": " {icon} {capacity}%", // Icon: bolt + // Not connected to AC + "format-discharging": "{icon} {capacity}%", + "format-icons": [ + "", // Icon: battery-full + "", // Icon: battery-three-quarters + "", // Icon: battery-half + "", // Icon: battery-quarter + "" // Icon: battery-empty + ], + "tooltip": true + }, + + "clock#time": { + "interval": 1, + "format": "{:%H:%M:%S}", + "tooltip": false + }, + + "clock#date": { + "interval": 10, + "format": " {:%e %b %Y}", // Icon: calendar-alt + "tooltip-format": "{:%e %B %Y}" + }, + + "cpu": { + "interval": 5, + "format": " {usage}% ({load})", // Icon: microchip + "states": { + "warning": 70, + "critical": 90 + } + }, + + "custom/keyboard-layout": { + "exec": "swaymsg -t get_inputs | grep -m1 'xkb_active_layout_name' | cut -d '\"' -f4", + // Interval set only as a fallback, as the value is updated by signal + "interval": 30, + "format": " {}", // Icon: keyboard + // Signal sent by Sway key binding (~/.config/sway/key-bindings) + "signal": 1, // SIGHUP + "tooltip": false + }, + + "memory": { + "interval": 5, + "format": " {}%", // Icon: memory + "states": { + "warning": 70, + "critical": 90 + } + }, + + "network": { + "interval": 5, + "format-wifi": " {essid} ({signalStrength}%)", // Icon: wifi + "format-ethernet": " {ifname}: {ipaddr}/{cidr}", // Icon: ethernet + "format-disconnected": "⚠ Disconnected", + "tooltip-format": "{ifname}: {ipaddr}" + }, + + "sway/mode": { + "format": " {}", // Icon: expand-arrows-alt + "tooltip": false + }, + + "sway/window": { + "format": "{}", + "max-length": 120 + }, + + "sway/workspaces": { + "all-outputs": false, + "disable-scroll": true, + "format": "{icon} {name}", + "format-icons": { + "1:www": "龜", // Icon: firefox-browser + "2:mail": "", // Icon: mail + "3:editor": "", // Icon: code + "4:terminals": "", // Icon: terminal + "5:portal": "", // Icon: terminal + "urgent": "", + "focused": "", + "default": "" + } + }, + + "wireplumber": { + "format": " {volume}%", + "format-muted": "", + }, + + //"pulseaudio": { + // //"scroll-step": 1, + // "format": "{icon} {volume}%", + // "format-bluetooth": "{icon} {volume}%", + // "format-muted": "", + // "format-icons": { + // "headphones": "", + // "handsfree": "", + // "headset": "", + // "phone": "", + // "portable": "", + // "car": "", + // "default": ["", ""] + // }, + // "on-click": "pavucontrol" + //}, + + "temperature": { + "critical-threshold": 80, + "interval": 5, + "format": "{icon} {temperatureC}°C", + "format-icons": [ + "", // Icon: temperature-empty + "", // Icon: temperature-quarter + "", // Icon: temperature-half + "", // Icon: temperature-three-quarters + "" // Icon: temperature-full + ], + "tooltip": true + }, + + "tray": { + "icon-size": 21, + "spacing": 10 + } + +} diff --git a/waybar/style.css b/waybar/style.css new file mode 100644 index 0000000..787fe7f --- /dev/null +++ b/waybar/style.css @@ -0,0 +1,194 @@ +/* ============================================================================= + * + * Waybar configuration + * + * Configuration reference: https://github.com/Alexays/Waybar/wiki/Configuration + * + * =========================================================================== */ + +/* ----------------------------------------------------------------------------- + * Keyframes + * -------------------------------------------------------------------------- */ + +@keyframes blink-warning { + 70% { + color: white; + } + + to { + color: white; + background-color: orange; + } +} + +@keyframes blink-critical { + 70% { + color: white; + } + + to { + color: white; + background-color: red; + } +} + + +/* ----------------------------------------------------------------------------- + * Base styles + * -------------------------------------------------------------------------- */ + +/* Reset all styles */ +* { + border: none; + border-radius: 0; + min-height: 0; + margin: 0; + padding: 0; +} + +/* The whole bar */ +#waybar { + background: #323232; + color: white; + font-family: Cantarell, Noto Sans, sans-serif; + font-size: 13px; +} + +/* Each module */ +#battery, +#clock, +#cpu, +#custom-keyboard-layout, +#memory, +#mode, +#network, +#pulseaudio, +#temperature, +#tray { + padding-left: 10px; + padding-right: 10px; +} + + +/* ----------------------------------------------------------------------------- + * Module styles + * -------------------------------------------------------------------------- */ + +#battery { + animation-timing-function: linear; + animation-iteration-count: infinite; + animation-direction: alternate; +} + +#battery.warning { + color: orange; +} + +#battery.critical { + color: red; +} + +#battery.warning.discharging { + animation-name: blink-warning; + animation-duration: 3s; +} + +#battery.critical.discharging { + animation-name: blink-critical; + animation-duration: 2s; +} + +#clock { + font-weight: bold; +} + +#cpu { + /* No styles */ +} + +#cpu.warning { + color: orange; +} + +#cpu.critical { + color: red; +} + +#memory { + animation-timing-function: linear; + animation-iteration-count: infinite; + animation-direction: alternate; +} + +#memory.warning { + color: orange; +} + +#memory.critical { + color: red; + animation-name: blink-critical; + animation-duration: 2s; +} + +#mode { + background: #64727D; + border-top: 2px solid white; + /* To compensate for the top border and still have vertical centering */ + padding-bottom: 2px; +} + +#network { + /* No styles */ +} + +#network.disconnected { + color: orange; +} + +#pulseaudio { + /* No styles */ +} + +#pulseaudio.muted { + /* No styles */ +} + +#custom-spotify { + color: rgb(102, 220, 105); +} + +#temperature { + /* No styles */ +} + +#temperature.critical { + color: red; +} + +#tray { + /* No styles */ +} + +#window { + font-weight: bold; +} + +#workspaces button { + border-top: 2px solid transparent; + /* To compensate for the top border and still have vertical centering */ + padding-bottom: 2px; + padding-left: 10px; + padding-right: 10px; + color: #888888; +} + +#workspaces button.focused { + border-color: #4c7899; + color: white; + background-color: #285577; +} + +#workspaces button.urgent { + border-color: #c9545d; + color: #c9545d; +}