dotfiles
My PC Dotfiles & Websitegit clone https://github.com/maydayv7/dotfiles
commit 8eae5b63132c1b387f9f1edc545c7dde499945bd parent 897339a92a35b63c9216d785c6fde65d150e69c0 Author: maydayv7 <maydayv7@gmail.com> Date: Mon, 4 Mar 2024 17:48:51 +0530 fix(Hyprland): Workflow Improvements Also fix scripts
Diffstat:
| A | files/geany/keybindings.conf | | | 152 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
| M | files/hyprland/binds.pango | | | 18 | ++++++++---------- |
| M | files/hyprland/pypr.toml | | | 1 | + |
| M | files/hyprland/waybar.css | | | 72 | ++++++++++++++++++++++++++++++++++++------------------------------------ |
| M | modules/gui/desktop/hyprland/apps/default.nix | | | 1 | + |
| M | modules/gui/desktop/hyprland/apps/security.nix | | | 2 | +- |
| M | modules/gui/desktop/hyprland/settings/default.nix | | | 13 | +++++++++---- |
| M | modules/gui/desktop/hyprland/settings/keybindings.nix | | | 26 | ++++++++++---------------- |
| M | modules/gui/desktop/hyprland/settings/plugins.nix | | | 4 | ++-- |
| M | scripts/commands.sh | | | 34 | +++++++++++++++++++--------------- |
| M | scripts/hyprutils.nix | | | 12 | +++++++++--- |
| M | scripts/nixos.nix | | | 3 | ++- |
12 files changed, 250 insertions(+), 88 deletions(-)
diff --git a/files/geany/keybindings.conf b/files/geany/keybindings.conf @@ -0,0 +1,152 @@ +[Bindings] +popup_gototagdefinition= +edit_transposeline=<Primary>t +edit_movelineup= +edit_movelinedown= +move_tableft=<Alt>Page_Up +move_tabright=<Alt>Page_Down +menu_new=<Primary>n +menu_open=<Primary>o +menu_open_selected=<Primary><Shift>o +menu_save=<Primary>s +menu_saveas= +menu_saveall=<Primary><Shift>s +file_properties=<Primary><Shift>v +menu_print=<Primary>p +menu_close=<Primary>w +menu_closeall=<Primary><Shift>w +menu_reloadfile=<Primary>r +menu_reloadall= +file_openlasttab= +menu_quit=<Primary>q +menu_undo=<Primary>z +menu_redo=<Primary>y +edit_duplicateline=<Primary>k +edit_deleteline=<Primary>d +edit_deletelinetoend=<Primary><Shift>Delete +edit_deletelinetobegin=<Primary><Shift>BackSpace +edit_scrolltoline=<Primary><Shift>l +edit_scrolllineup=<Alt>Up +edit_scrolllinedown=<Alt>Down +edit_completesnippet=Tab +move_snippetnextcursor= +edit_suppresssnippetcompletion= +popup_contextaction= +edit_autocomplete=<Primary>space +edit_calltip=<Primary><Shift>space +edit_wordpartcompletion=Tab +menu_cut=<Primary>x +menu_copy=<Primary>c +menu_paste=<Primary>v +edit_copyline=<Primary><Shift>c +edit_cutline=<Primary><Shift>x +menu_selectall=<Primary>a +edit_selectword=<Shift><Alt>w +edit_selectline=<Shift><Alt>l +edit_selectparagraph=<Shift><Alt>p +edit_selectwordpartleft= +edit_selectwordpartright= +edit_togglecase=<Primary><Alt>u +edit_commentlinetoggle=<Primary>e +edit_commentline= +edit_uncommentline= +edit_increaseindent=<Primary>i +edit_decreaseindent=<Primary>u +edit_increaseindentbyspace= +edit_decreaseindentbyspace= +edit_autoindent= +edit_sendtocmd1=<Primary>1 +edit_sendtocmd2=<Primary>2 +edit_sendtocmd3=<Primary>3 +edit_sendtocmd4= +edit_sendtocmd5= +edit_sendtocmd6= +edit_sendtocmd7= +edit_sendtocmd8= +edit_sendtocmd9= +edit_sendtovte= +format_reflowparagraph=<Primary>j +edit_joinlines= +menu_insert_date=<Shift><Alt>d +edit_insertwhitespace= +edit_insertlinebefore= +edit_insertlineafter= +menu_preferences=<Primary><Alt>p +menu_pluginpreferences= +menu_find=<Primary>f +menu_findnext=<Primary>g +menu_findprevious=<Primary><Shift>g +menu_findnextsel= +menu_findprevsel= +menu_replace=<Primary>h +menu_findinfiles=<Primary><Shift>f +menu_nextmessage= +menu_previousmessage= +popup_findusage=<Primary><Shift>e +popup_finddocumentusage=<Primary><Shift>d +find_markall=<Primary><Shift>m +nav_back=<Alt>Left +nav_forward=<Alt>Right +menu_gotoline=<Primary>l +edit_gotomatchingbrace=<Primary>b +edit_togglemarker=<Primary>m +edit_gotonextmarker=<Primary>period +edit_gotopreviousmarker=<Primary>comma +popup_gototagdeclaration=<Primary><Shift>t +edit_gotolinestart=Home +edit_gotolineend=End +edit_gotolinestartvisual=<Alt>Home +edit_gotolineendvisual=<Alt>End +edit_prevwordstart=<Primary>slash +edit_nextwordstart=<Primary>backslash +menu_toggleall= +menu_fullscreen=F11 +menu_messagewindow= +toggle_sidebar= +menu_zoomin=<Primary>plus +menu_zoomout=<Primary>minus +normal_size=<Primary>0 +menu_linewrap= +menu_linebreak= +menu_clone= +menu_strip_trailing_spaces= +menu_replacetabs= +menu_replacespaces= +menu_togglefold= +menu_foldall= +menu_unfoldall= +reloadtaglist=<Primary><Shift>r +remove_markers= +remove_error_indicators= +remove_markers_and_indicators= +project_new= +project_new_from_folder= +project_open= +project_properties= +project_close= +build_compile=F8 +build_link=F9 +build_make=<Shift>F9 +build_makeowntarget=<Primary><Shift>F9 +build_makeobject=<Shift>F8 +build_nexterror= +build_previouserror= +build_run=F5 +build_options= +menu_opencolorchooser= +menu_help=F1 +switch_editor=F2 +switch_search_bar=F7 +switch_message_window= +switch_compiler= +switch_messages= +switch_scribble=F6 +switch_vte=F4 +switch_sidebar= +switch_sidebar_symbol_list= +switch_sidebar_doc_list= +switch_tableft=<Primary>Page_Up +switch_tabright=<Primary>Page_Down +switch_tablastused=<Primary>Tab +move_tabfirst= +move_tablast= diff --git a/files/hyprland/binds.pango b/files/hyprland/binds.pango @@ -1,28 +1,27 @@ <span size="10.75pt"> <b><big>Keyboard Shortcuts</big></b> <b><big>Mouse Actions</big></b> -<i>$mod -> SUPER</i> <i>L'</i> or <i>R' -> Left/Right Click</i> +<i>$mod -> SUPER</i> <i>L' -> Left Click</i> +<i> -> ALT Release Selection</i> <i>R' -> Right Click</i> <tt>$mod Q</tt> Quit application <tt>$mod L'</tt> Move window <tt>$mod P</tt> Pin window on all Workspaces <tt>$mod R'</tt> Window resize <tt>$mod M</tt> Maximize window <tt>$mod CTRL L'</tt> Window resize <tt>$mod SHIFT M</tt> Fullscreen window <tt>$mod SHIFT L'</tt> Move window into application group <tt>ALT Q</tt> Minimize window -<tt>ALT SHIFT Q</tt> Show minimized windows +<tt>ALT SHIFT Q </tt> Show all minimized windows <tt>$mod <i>ARROW</i></tt> Switch focus to window in desired direction <tt>$mod SHIFT <i>ARROW</i></tt> Swap current window with window in desired direction <tt>$mod Space</tt> Change window split direction - -<tt>ALT [CTRL] Tab</tt> Cycle [backwards] through open applications -<tt>ALT SHIFT Tab</tt> Activate urgent/last window <tt>$mod SHIFT Space</tt> Toggle application grouping -<tt>$mod [SHIFT] Tab</tt> Cycle [backwards] through grouped applications -<tt>ALT `</tt> Show overview -<tt>ALT SHIFT `</tt> Show overview with every open application + +<tt>ALT [SHIFT] Tab </tt> Show application overview [of all workspaces] <tt>ALT <i>ARROW</i></tt> Switch to window in desired direction in overview +<tt>ALT CTRL Tab</tt> Activate urgent/last window +<tt>ALT [SHIFT] `</tt> Cycle [backwards] through grouped applications <tt>$mod <i>NUM</i></tt> Create workspace '<i>NUM</i>' <tt>$mod SHIFT <i>NUM</i></tt> Move window to workspace '<i>NUM</i>' -<tt>$mod ,<i> or </i>.</tt> Move to previous/next workspace +<tt>$mod ,<i> or </i>.</tt> Move to previous/next non-empty workspace <tt>$mod `</tt> Toggle special workspace to stash windows <tt>$mod SHIFT `</tt> Move window to/from special workspace stash <tt>$mod SHIFT ,<i> or </i>.</tt> Move window to previous/next workspace @@ -49,5 +48,4 @@ <tt>$mod Enter</tt> Task Manager <tt>$mod N</tt> Show received notifications in order <tt>$mod /</tt> Application Launcher -<tt>Calculator</tt> Calculator </span> diff --git a/files/hyprland/pypr.toml b/files/hyprland/pypr.toml @@ -15,6 +15,7 @@ size = "75% 60%" animation = "fromBottom" command = "nwg-clipman -nw" class = "nwg-clipman" +lazy = true size = "75% 65%" margin = 30 diff --git a/files/hyprland/waybar.css b/files/hyprland/waybar.css @@ -9,10 +9,31 @@ window#waybar { background-color: transparent; } +#custom-logo { + color: #ffffff; +} + +#user > image { + padding-right: 5px; +} + #waybar.empty #window { background: none; } +.modules-left #workspaces button { + border: 2px solid @base00; +} + +.modules-left #workspaces button.active { + border: 2px solid @base03; +} + +.modules-left #workspaces button.empty { + color: @base07; + background-color: transparent; +} + #taskbar button.active { background: @base03; } @@ -25,6 +46,15 @@ window#waybar { border: 2px solid @base08; } +#tray { + background-color: @base08; +} + +#mpris { + color: @base00; + background-color: @base05; +} + @keyframes blink { to { background-color: #ffffff; @@ -40,56 +70,26 @@ window#waybar { animation-direction: alternate; } -#tray { - background-color: @base08; +#custom-weather { + color: @base00; + background-color: @base06; } .modules-right #clock { background-color: @base0A; } -#custom-logo { - color: #ffffff; -} - #custom-dunst { color: @base0A; } -#custom-power { - color: @base08; -} - -#mpris { - color: @base00; - background-color: @base05; -} - -#custom-weather { - color: @base00; - background-color: @base06; -} - .modules-right #idle_inhibitor { color: @base09; background-color: transparent; } -.modules-left #workspaces button.empty { - color: @base07; - background-color: transparent; -} - -.modules-left image { - padding-left: 5px; - background-color: @base0F; - border-top-right-radius: 0px; - border-bottom-right-radius: 0px; -} - -.modules-left #user { - border-top-left-radius: 0px; - border-bottom-left-radius: 0px; +#custom-power { + color: @base08; } #backlight, @@ -109,5 +109,5 @@ window#waybar { #window, #wireplumber, #workspaces { - padding: 2px 5px 2px 5px; + padding: 0 5px 0 5px; } diff --git a/modules/gui/desktop/hyprland/apps/default.nix b/modules/gui/desktop/hyprland/apps/default.nix @@ -283,6 +283,7 @@ in { # Text Editor ".config/geany/geany.conf".text = geany.settings; + ".config/geany/keybindings.conf".text = geany.keybindings; ".config/geany/colorschemes/theme.conf".text = geany.catppuccin; # Terminal diff --git a/modules/gui/desktop/hyprland/apps/security.nix b/modules/gui/desktop/hyprland/apps/security.nix @@ -40,7 +40,7 @@ in { } { event = "lock"; - command = "sh -c '${getExe pkgs.custom.hyprutils} toggle_media; ${getExe locker} -f'"; + command = let toggle = "${getExe pkgs.custom.hyprutils} toggle_media"; in "sh -c '${toggle}; ${getExe locker}; ${toggle}'"; } ]; timeouts = [ diff --git a/modules/gui/desktop/hyprland/settings/default.nix b/modules/gui/desktop/hyprland/settings/default.nix @@ -3,7 +3,11 @@ lib, util, ... -}: { +}: let + inherit (lib) mkForce mkIf; + inherit (sys.gui) fancy; + inherit (sys.lib.stylix.colors) base0A base0D; +in { ## Hyprland Settings imports = util.map.modules.list ./.; stylix.targets.hyprland.enable = true; @@ -70,7 +74,7 @@ general = { resize_on_border = true; - allow_tearing = !sys.gui.fancy; + allow_tearing = !fancy; } // # Visuals @@ -78,9 +82,10 @@ gaps_in = 5; gaps_out = 5; border_size = 2; + "col.active_border" = mkForce "rgb(${base0A}) rgb(${base0D}) 45deg"; }; - group.groupbar = with sys.lib.stylix.colors; { + group.groupbar = { enabled = true; render_titles = false; height = 7; @@ -114,7 +119,7 @@ ]; }; - decoration = lib.mkIf sys.gui.fancy { + decoration = mkIf fancy { rounding = 10; drop_shadow = true; shadow_ignore_window = true; diff --git a/modules/gui/desktop/hyprland/settings/keybindings.nix b/modules/gui/desktop/hyprland/settings/keybindings.nix @@ -9,12 +9,15 @@ _: { "$mod, P, pin" "$mod, M, fullscreen, 1" "$mod SHIFT, M, fullscreen," + "$mod, Space, togglesplit" - # Focus Change + # Window Focus "$mod, left, movefocus, l" "$mod, right, movefocus, r" "$mod, up, movefocus, u" "$mod, down, movefocus, d" + "ALT CTRL, Tab, focusurgentorlast" + "ALT CTRL, Tab, bringactivetotop," # Window Swap "$mod SHIFT, left, swapwindow, l" @@ -22,25 +25,16 @@ _: { "$mod SHIFT, up, swapwindow, u" "$mod SHIFT, down, swapwindow, d" - # Tiling - "$mod, Space, togglesplit" - "$mod SHIFT, Space, togglegroup" - "$mod, Tab, changegroupactive, f" - "$mod SHIFT, Tab, changegroupactive, b" + # Window Groups + "$mod SHIFT, space, togglegroup" + "ALT, grave, changegroupactive, f" + "ALT SHIFT, grave, changegroupactive, b" # Floating Mode "$mod, semicolon, togglefloating," "$mod, apostrophe, workspaceopt, allfloat" "$mod, C, centerwindow" - # Window Switcher - "ALT, Tab, cyclenext," - "ALT, Tab, bringactivetotop," - "ALT SHIFT, Tab, focusurgentorlast" - "ALT SHIFT, Tab, bringactivetotop," - "ALT CTRL, Tab, cyclenext, prev" - "ALT CTRL, Tab, bringactivetotop," - # Cycle Workspaces "$mod, comma, workspace, m-1" "$mod, period, workspace, m+1" @@ -50,8 +44,8 @@ _: { "$mod SHIFT, grave, exec, pypr toggle_special stash" # Move Window to Workspace - "$mod SHIFT, comma, movetoworkspace, m-1" - "$mod SHIFT, period, movetoworkspace, m+1" + "$mod SHIFT, comma, movetoworkspace, r-1" + "$mod SHIFT, period, movetoworkspace, r+1" # Cycle Monitors "$mod ALT, comma, focusmonitor, l" diff --git a/modules/gui/desktop/hyprland/settings/plugins.nix b/modules/gui/desktop/hyprland/settings/plugins.nix @@ -44,8 +44,8 @@ "ALT SHIFT, Q, hych:toggle_restore_window" # Overview - "ALT, grave, hycov:toggleoverview" - "ALT SHIFT, grave, hycov:toggleoverview, forceall" + "ALT, Tab, hycov:toggleoverview" + "ALT SHIFT, Tab, hycov:toggleoverview, forceall" "ALT, left, hycov:movefocus, l" "ALT, right, hycov:movefocus, r" "ALT, up, hycov:movefocus, u" diff --git a/scripts/commands.sh b/scripts/commands.sh @@ -3,6 +3,15 @@ # Useful Commands # +temp(){ + TEMP=/tmp/"$1" + if [ -z "$2" ] + then + rm -rf "$TEMP" + fi + mkdir -p "$TEMP" +} + extract() { if [ -f "$1" ] then @@ -26,13 +35,6 @@ extract() { fi } -internet() { - if ! nc -zw1 google.com 443 2> /dev/null - then - error "You are Offline, Please Connect to the Internet" - fi -} - up() { LIMIT=$1 P=$PWD/.. @@ -43,14 +45,11 @@ up() { cd "$P" || exit } -newline() { - echo -e "\n"; -} - -temp(){ - TEMP=/tmp/script - rm -rf "$TEMP" - mkdir -p "$TEMP" +internet() { + if ! nc -zw1 google.com 443 2> /dev/null + then + error "You are Offline, Please Connect to the Internet" + fi } restart() { @@ -61,6 +60,11 @@ restart() { esac } +# Print + +newline() { + echo -e "\n"; +} error() { echo -e "\n\033[0;31merror:\033[0m $1" diff --git a/scripts/hyprutils.nix b/scripts/hyprutils.nix @@ -18,16 +18,22 @@ in name = "hyprutils"; runtimeInputs = with pkgs; [ coreutils + dunst + gnugrep alsa-utils brillo playerctl libnotify + swayidle systemd wget ]; text = '' set +eu + ${files.scripts.commands} + temp hyprutils preserve + show_album_art=true show_music_in_volume_indicator=true @@ -51,8 +57,8 @@ in elif [[ "$url" == "http://"* ]] || [[ "$url" == "https://"* ]] then filename="$(echo "$url" | sed "s/.*\///")" - if [ ! -f "/tmp/$filename" ]; then wget -O "/tmp/$filename" "$url"; fi - media_icon="/tmp/$filename" + if [ ! -f "$TEMP/$filename" ]; then wget -O "$TEMP/$filename" "$url"; fi + media_icon="$TEMP/$filename" fi fi } @@ -145,7 +151,7 @@ in ;; toggle_media) - FILE="/tmp/playerctl_status" + FILE="$TEMP/toggle_media" if test -f "$FILE" then rm "$FILE" diff --git a/scripts/nixos.nix b/scripts/nixos.nix @@ -89,6 +89,7 @@ in cachix coreutils git + gnugrep gnupg gnused jq @@ -142,7 +143,7 @@ in fi ;; "--delta") - temp + temp nixos-build pushd "$TEMP" &> /dev/null echo "Building Configuration..." if nixos-rebuild build --flake ${path.system}#