diff --git a/config/hypr/hypridle.conf b/config/hypr/hypridle.conf new file mode 100644 index 0000000..3b04bc8 --- /dev/null +++ b/config/hypr/hypridle.conf @@ -0,0 +1,16 @@ +general { + lock_cmd = pidof hyprlock || hyprlock # avoid starting multiple hyprlock instances. + before_sleep_cmd = loginctl lock-session # lock before suspend. + after_sleep_cmd = hyprctl dispatch dpms on # to avoid having to press a key twice to turn on the display. +} + +listener { + timeout = 300 # 5min + on-timeout = hyprctl dispatch dpms off # screen off when timeout has passed + on-resume = hyprctl dispatch dpms on # screen on when activity is detected after timeout has fired. +} + +listener { + timeout = 1800 # 30min + on-timeout = systemctl suspend # suspend pc +} diff --git a/config/hypr/hyprland.conf b/config/hypr/hyprland.conf index 4504730..9638448 100644 --- a/config/hypr/hyprland.conf +++ b/config/hypr/hyprland.conf @@ -36,7 +36,7 @@ monitor=,preferred,auto,auto $terminal = kitty $fileManager = dolphin $browser = brave -$menu = wofi --show drun +$menu = rofi -show drun ################# @@ -49,14 +49,15 @@ exec = gsettings set org.gnome.desktop.interface gtk-theme "Adwaita-dark" # fo exec = gsettings set org.gnome.desktop.interface color-scheme "prefer-dark" # for GTK4 apps exec-once = /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 - - -# exec-once = waybar -exec-once = $browser -exec-once = flatpak run com.moonlight_stream.Moonlight -exec-once = $terminal +exec-once = waybar +exec-once = hypridle # exec-once = nm-applet & -# exec-once = waybar & hyprpaper & firefox + + +exec-once = [workspace 1 silent] $terminal +exec-once = [workspace 2 silent] $browser +# exec-once = [workspace 3 silent] flatpak run com.moonlight_stream.Moonlight +exec-once = [workspace special:magic silent] kitty ############################# @@ -94,7 +95,7 @@ general { # Please see https://wiki.hyprland.org/Configuring/Tearing/ before you turn this on allow_tearing = false - layout = master + layout = dwindle } # https://wiki.hyprland.org/Configuring/Variables/#decoration @@ -190,9 +191,9 @@ input { kb_layout = se kb_variant = kb_model = - kb_options = kb_rules = - + kb_options = ctrl:nocaps, fkeys:basic_13-24 + follow_mouse = 1 sensitivity = 0 # -1.0 - 1.0, 0 means no modification. @@ -223,12 +224,15 @@ device { $mainMod = SHIFT ALT # Sets "Windows" key as main modifier # Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more +bind = $mainMod, Q, exec, wlogout bind = $mainMod, T, exec, $terminal bind = $mainMod, C, killactive, bind = $mainMod, M, exit, bind = $mainMod, E, exec, $fileManager bind = $mainMod, F, togglefloating, bind = $mainMod, D, exec, $menu +bind = ALT, Tab, workspace, m+1 +bind = ALT SHIFT, Tab, workspace, m-1 # Move focus with mainMod + arrow keys bind = $mainMod, left, movefocus, l @@ -262,7 +266,7 @@ bind = $mainMod SUPER, 0, movetoworkspace, 10 # Example special workspace (scratchpad) bind = $mainMod, S, togglespecialworkspace, magic -bind = $mainMod SHIFT, S, movetoworkspace, special:magic +bind = $mainMod SUPER, S, movetoworkspace, special:magic # Scroll through existing workspaces with mainMod + scroll bind = $mainMod, mouse_down, workspace, e+1 @@ -298,6 +302,8 @@ bindl = , XF86AudioPrev, exec, playerctl previous # Example windowrule v2 # windowrulev2 = float,class:^(kitty)$,title:^(kitty)$ +windowrulev2 = float,title:^(Volume Control)$ +windowrulev2 = float,title:^(Helvum - Pipewire Patchbay)$ # windowrulev2 = float,class:(com.moonlight_stream.moonlight),title:(moonlight) # windowrulev2 = tile,class:(com.moonlight_stream.moonlight),title:(moonlight) diff --git a/config/networkmanager-dmenu/config.ini b/config/networkmanager-dmenu/config.ini new file mode 100644 index 0000000..79d239c --- /dev/null +++ b/config/networkmanager-dmenu/config.ini @@ -0,0 +1,49 @@ +[dmenu] +dmenu_command = rofi -dmenu +# # Note that dmenu_command can contain arguments as well like: +# # `dmenu_command = rofi -dmenu -i -theme nmdm` +# # `dmenu_command = rofi -dmenu -width 30 -i` +# # `dmenu_command = dmenu -i -l 25 -b -nb #909090 -nf #303030` +# # `dmenu_command = fuzzel --dmenu` +# # `dmenu_command = wofi --dmenu` +# active_chars = == +# highlight = # (Default: False) use highlighting instead of active_chars (only applicable to Rofi / Wofi) +# highlight_fg = # (Default: None) foreground color of active connection (only applicable to Wofi) +# highlight_bg = # (Default: None) background color of active connection (only applicable to Wofi) +# highlight_bold = # (Default: True) make active connection bold (only applicable to Wofi) +# compact = # (Default: False). Remove extra spacing from display +# pinentry = # (Default: None) e.g. `pinentry-gtk` +# wifi_chars = +# wifi_chars = ▂▄▆█ +# wifi_icons = +# wifi_icons = 󰤯󰤟󰤢󰤥󰤨 +# format = +# format = {name} {sec} {bars} +# # Available variables are: +# # * {name} - Access point name +# # * {sec} - Security type +# # * {signal} - Signal strength on a scale of 0-100 +# # * {bars} - Bar-based display of signal strength (see wifi_chars) +# # * {icon} - Icon-based display of signal strength (see wifi_icons) +# # * {max_len_name} and {max_len_sec} are the maximum lengths of {name} / {sec} +# # respectively and may be useful for formatting. +# list_saved = # (Default: False) list saved connections + +[dmenu_passphrase] +# # Uses the -password flag for Rofi, -x for bemenu. For dmenu, sets -nb and +# # -nf to the same color or uses -P if the dmenu password patch is applied +# # https://tools.suckless.org/dmenu/patches/password/ +# obscure = True +# obscure_color = #222222 + +[pinentry] +# description = (Default: Get network password) +# prompt = (Default: Password:) + +[editor] +terminal = kitty +# gui_if_available = (Default: True) +# gui = (Default: nm-connection-editor) + +[nmdm] +# rescan_delay = # (seconds to wait after a wifi rescan before redisplaying the results) diff --git a/config/waybar/config b/config/waybar/config new file mode 100644 index 0000000..50ff4b5 --- /dev/null +++ b/config/waybar/config @@ -0,0 +1,107 @@ +// ============================================================================= +// +// 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", + ], + "modules-center": [ + "clock", + ], + "modules-right": [ + "tray", + "custom/separator", + "wireplumber", + "custom/separator", + "network", + "custom/separator", + "memory", + "custom/separator", + "cpu", + "custom/separator", + ], + + + // ------------------------------------------------------------------------- + // Modules + // ------------------------------------------------------------------------- + + "custom/separator": { + "format": "|", + "interval": "once", + "tooltip": false + }, + + "wireplumber": { + "format": "VOL:{volume:03}%", + "format-muted": "VOL:---%", + "on-click": "pavucontrol", + "max-volume": 150, + "scroll-step": 0.2, + }, + + "clock": { + "interval": 10, + "format": "{:%A - %B %d %Y - %R}", + }, + + "cpu": { + "interval": 5, + "format": "CPU:{usage:02}%", // Icon: microchip + "states": { + "warning": 70, + "critical": 90 + }, + }, + + "memory": { + "interval": 10, + "format": "RAM:{used:0.1f}G/{total:0.1f}G", // Icon: memory + "states": { + "warning": 70, + "critical": 90 + }, + "tooltip-format": "RAM used: {percentage}%\nSWAP used: {swapPercentage}%" + }, + + "network": { + "interval": 5, + "on-click": "networkmanager_dmenu", + "format-wifi": "WIFI:{essid} ({signalStrength}%)", // Icon: wifi + "format-ethernet": "ETH:{ipaddr}", // Icon: ethernet + "format-disconnected": "ETH Disconnected", + "tooltip-format": "{ifname}: {ipaddr}" + }, + + "hyprland/window": { + "format": " {}", + "max-length": 120 + }, + + "hyprland/workspaces": { + "all-outputs": false, + "disable-scroll": true, + "format": "{name}", + }, + + "tray": { + "icon-size": 18, + "spacing": 10 + } +} diff --git a/config/waybar/style.css b/config/waybar/style.css new file mode 100644 index 0000000..abccc1e --- /dev/null +++ b/config/waybar/style.css @@ -0,0 +1,145 @@ +/* ============================================================================= + * + * 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: #000000; + color: #eeeeee; + font-family: Source Code Pro; + font-size: 14px; +} + +/* Each module */ +#clock, +#cpu, +#memory, +#network, +#pulseaudio, +#wireplumber, +#custom-separator, +#tray { + padding-left: 0px; + padding-right: 10px; +} + +/* ----------------------------------------------------------------------------- + * Module styles + * -------------------------------------------------------------------------- */ + +#clock { +} + +#wireplumber { + color: #afd787; +} + +#wireplumber.muted { + color: #d7af5f; +} + +#cpu { + color: #afd787; +} + +#cpu.warning { + color: #d7af5f; +} + +#cpu.critical { + color: #d75400; +} + +#memory { + color: #afd787; +} + +#memory.warning { + color: #d7af5f; +} + +#memory.critical { + color: #d75400; +} + +#network { + color: #afd787; +} + +#network.disconnected { + color: #d7af5f; +} + +#temperature { + color: #afd787; +} + +#temperature.critical { + color: #d75400; +} + +#custom-separator { + color: #eeeeee; +} + +#tray { +} + +#window { +} + +#workspaces button { + margin-top: 4px; + margin-bottom: 4px; + padding-left: 5px; + padding-right: 5px; + color: #eeeeee; +} + +#workspaces button.active { + border-color: #000000; + color: #000000; + background-color: #afd787; +} diff --git a/update_arch.sh b/update_arch.sh index d912b08..dbc68b2 100755 --- a/update_arch.sh +++ b/update_arch.sh @@ -20,25 +20,25 @@ sudo pacman -Suyy --noconfirm # Update all AUR packages printf -- '\033[33m Updating AUR packages\n\033[37m' if pacman -Qs yay >/dev/null; then - yay --noconfirm --aur + yay --noconfirm --aur else - sudo pacman -S --needed --noconfirm git base-devel - if [ -d ~/yay-bin ]; then rm -rf ~/yay-bin; fi - cd ~ - git clone https://aur.archlinux.org/yay-bin.git - cd yay-bin - makepkg --noconfirm -si - cd ~ - if [ -d ~/yay-bin ]; then rm -rf ~/yay-bin; fi + sudo pacman -S --needed --noconfirm git base-devel + if [ -d ~/yay-bin ]; then rm -rf ~/yay-bin; fi + cd ~ + git clone https://aur.archlinux.org/yay-bin.git + cd yay-bin + makepkg --noconfirm -si + cd ~ + if [ -d ~/yay-bin ]; then rm -rf ~/yay-bin; fi fi # Update all Flatpak packages printf -- '\033[33m Updating Flatpak packages\n\033[37m' if pacman -Qs flatpak >/dev/null; then - flatpak update -y + flatpak update -y else - sudo pacman --noconfirm --needed -S flatpak - flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo - flatpak install -y flathub com.github.tchx84.Flatseal + sudo pacman --noconfirm --needed -S flatpak + flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo + flatpak install -y flathub com.github.tchx84.Flatseal fi # Install initial system packages @@ -56,11 +56,34 @@ ln -sf ~/code_server/gitconfig ~/.gitconfig # Install hyprland printf -- '\033[33m Installing hyprland\n\033[37m' -sudo pacman --noconfirm --needed -S dunst waybar rofi hyprland hyprlock polkit-gnome xorg-xhost gnome-keyring pipewire qt5ct qt6ct gnome-themes-extra qt5-wayland qt6-wayland lxappearance +sudo pacman --noconfirm --needed -S plymouth dracut dunst hypridle hyprland hyprlock polkit-gnome xorg-xhost gnome-keyring qt5ct qt6ct gnome-themes-extra qt5-wayland qt6-wayland lxappearance yay --noconfirm -S --needed --aur adwaita-qt5-git yay --noconfirm -S --needed --aur adwaita-qt6-git +yay --noconfirm -S --needed --aur wlogout + mkdir -p ~/.config/hypr ln -sf ~/code_server/config/hypr/hyprland.conf ~/.config/hypr/hyprland.conf +ln -sf ~/code_server/config/hypr/hypridle.conf ~/.config/hypr/hypridle.conf + +# Install rofi +printf -- '\033[33m Installing rofi\n\033[37m' +sudo pacman --noconfirm --needed -S rofi-wayland + +# Install waybar +printf -- '\033[33m Installing waybar\n\033[37m' +sudo pacman --noconfirm --needed -S waybar +ln -sf ~/code_server/config/waybar/config ~/.config/waybar/config +ln -sf ~/code_server/config/waybar/style.css ~/.config/waybar/style.css + +# Install Audio +printf -- '\033[33m Installing Audio\n\033[37m' +sudo pacman --noconfirm --needed -S pipewire pipewire-pulse pavucontrol helvum + +# Install networkmanager +printf -- '\033[33m Installing networkmanager\n\033[37m' +sudo pacman --noconfirm --needed -S network-manager-applet +yay --noconfirm -S --needed --aur networkmanager-dmenu-git +ln -sf ~/code_server/config/networkmanager-dmenu/config.ini ~/.config/networkmanager-dmenu/config.ini # Install autologin printf -- '\033[33m Installing autologin\n\033[37m' @@ -117,12 +140,12 @@ sudo mv virtualhereclient.service /etc/systemd/system/virtualhereclient.service # Install teensy udev rules (only for non docker system) if [ ! -f /.dockerenv ]; then - printf -- '\033[33m Installing teensy udev rules\n\033[37m' - sudo rm -f /tmp/00-teensy.rules /etc/udev/rules.d/00-teensy.rules /lib/udev/rules.d/00-teensy.rules - sudo wget -O /tmp/00-teensy.rules https://www.pjrc.com/teensy/00-teensy.rules - sudo install -o root -g root -m 0664 /tmp/00-teensy.rules /lib/udev/rules.d/00-teensy.rules - sudo udevadm control --reload-rules - sudo udevadm trigger + printf -- '\033[33m Installing teensy udev rules\n\033[37m' + sudo rm -f /tmp/00-teensy.rules /etc/udev/rules.d/00-teensy.rules /lib/udev/rules.d/00-teensy.rules + sudo wget -O /tmp/00-teensy.rules https://www.pjrc.com/teensy/00-teensy.rules + sudo install -o root -g root -m 0664 /tmp/00-teensy.rules /lib/udev/rules.d/00-teensy.rules + sudo udevadm control --reload-rules + sudo udevadm trigger fi # Install neovim @@ -249,11 +272,15 @@ flatpak install -y flathub org.kde.krita # Install KiCad printf -- '\033[33m Installing KiCad\n\033[37m' -flatpak install -y flathub org.kicad.KiCad +sudo pacman --noconfirm --needed -S kicad # Install FreeCad printf -- '\033[33m Installing FreeCad\n\033[37m' -flatpak install -y flathub org.freecadweb.FreeCAD +sudo pacman --noconfirm --needed -S freecad + +# Install Prusaslicer +printf -- '\033[33m Installing Prusaslicer\n\033[37m' +flatpak install -y flathub com.prusa3d.PrusaSlicer # Install Moonlight printf -- '\033[33m Installing Moonlight\n\033[37m' @@ -297,9 +324,6 @@ sudo pacman --noconfirm --needed -S virtualbox virtualbox-guest-iso yay --noconfirm -S --needed --aur virtualbox-ext-oracle sudo usermod -a -G vboxusers "$USER" -printf -- '\033[33m Installing Audio control\n\033[37m' -sudo pacman --noconfirm --needed -S pavucontrol helvum - # Install timeshift printf -- '\033[33m Installing Timeshift\n\033[37m' sudo pacman --noconfirm --needed -S timeshift