diff --git a/eww_laptop/scripts/auto_dock.sh b/eww_laptop/scripts/auto_dock.sh new file mode 100755 index 0000000..1abba04 --- /dev/null +++ b/eww_laptop/scripts/auto_dock.sh @@ -0,0 +1,46 @@ +#!/bin/bash + +bat=/sys/class/power_supply/BAT0/ +char="$(cat "$bat/status")" +monitor_count=$(hyprctl monitors | rg "ID 1") +internal_active=$(hyprctl monitors | rg "eDP-1") + + +close() { +if [ "$char" == "Discharging" ]; then + # dunstify 'discharging and locking' + playerctl --all-players -a pause + swaylock -c 000000 & systemctl suspend +else + if [ "$monitor_count" == "" ]; then + # dunstify 'charging but no second monitor, locking' + playerctl --all-players -a pause + swaylock -c 000000 & systemctl suspend + else + dunstify 'charging and second monitor, switching to external mode' + ./monitor.sh onlysecond + fi +fi +} + +open() { + if [ "$internal_active" == "" ]; then + if [ "$monitor_count" == "" ]; then + dunstify 'external monitor connected, extending' + ./monitor.sh extend + else + dunstify 'only internal' + ./monitor.sh onlyfirst + fi + fi +} + + +if [ "$1" == "open" ]; then + open +else + close +fi + + + diff --git a/eww_laptop/scripts/monitor.sh b/eww_laptop/scripts/monitor.sh new file mode 100755 index 0000000..7ccbc27 --- /dev/null +++ b/eww_laptop/scripts/monitor.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +onlysecond() { + dunstify "Switching to external monitor only" + hyprctl keyword monitor ,highrr,0x0,1 + hyprctl keyword monitor eDP-1,disabled +} + +onlyfirst() { + dunstify "Switching to internal monitor only" + hyprctl keyword monitor ,disabled + hyprctl keyword monitor eDP-1,1920x1080@144,0x0,1 +} + +extend() { + dunstify "Switching to extend mode" + hyprctl keyword monitor ,highrr,1920x0,1 + hyprctl keyword monitor eDP-1,1920x1080@144,0x0,1 +} + +mirror() { + dunstify "Switching to mirror mode" + hyprctl keyword monitor ,highrr,0x0,1 + hyprctl keyword monitor eDP-1,1920x1080@144,0x0,1 +} + + +if [ "$1" == "onlysecond" ]; then + onlysecond +elif [ "$1" == "onlyfirst" ]; then + onlyfirst +elif [ "$1" == "extend" ]; then + extend +elif [ "$1" == "mirror" ]; then + mirror +fi diff --git a/eww_laptop/scripts/test.py b/eww_laptop/scripts/test.py new file mode 100644 index 0000000..1996694 --- /dev/null +++ b/eww_laptop/scripts/test.py @@ -0,0 +1,23 @@ +#!/usr/bin/env python3 + +import os +import socket + +# Replace "your_user" with the actual username of the logged-in user. +USER = "dashie" + +def execute_script(event): + # This function executes the script file as the specified user. + os.system(f"/home/dashie/.config/eww/scripts/auto_dock.sh {event}") + +# Create a socket object and connect to the acpid socket. +sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) +sock.connect("/var/run/acpid.socket") + +# Listen for events and execute the script file. +while True: + data = sock.recv(1024).decode() + if "button/lid" in data: + event = data.split()[-1] + execute_script(event) + diff --git a/fish/fishd.tmp.415wWp b/fish/fishd.tmp.415wWp new file mode 100644 index 0000000..e69de29 diff --git a/fish/fishd.tmp.4LjhRf b/fish/fishd.tmp.4LjhRf new file mode 100644 index 0000000..e69de29 diff --git a/fish/fishd.tmp.AMZwyo b/fish/fishd.tmp.AMZwyo new file mode 100644 index 0000000..e69de29 diff --git a/fish/fishd.tmp.CYgWeH b/fish/fishd.tmp.CYgWeH new file mode 100644 index 0000000..e69de29 diff --git a/fish/fishd.tmp.P3t4oH b/fish/fishd.tmp.P3t4oH new file mode 100644 index 0000000..e69de29 diff --git a/fish/fishd.tmp.QlHUNi b/fish/fishd.tmp.QlHUNi new file mode 100644 index 0000000..e69de29 diff --git a/fish/fishd.tmp.arfTTC b/fish/fishd.tmp.arfTTC new file mode 100644 index 0000000..e69de29 diff --git a/fish/fishd.tmp.olcdsf b/fish/fishd.tmp.olcdsf new file mode 100644 index 0000000..e69de29 diff --git a/hypr_laptop/hyprland.conf b/hypr_laptop/hyprland.conf index f678122..e0cb1b2 100644 --- a/hypr_laptop/hyprland.conf +++ b/hypr_laptop/hyprland.conf @@ -62,6 +62,8 @@ gestures { misc { vfr=true vrr=1 + animate_manual_resizes=true + animate_mouse_windowdragging=false # enable_swallow=true # swallow_regex=^(.*)(kitty)(.*)$ } @@ -112,6 +114,9 @@ bind=SUPERSHIFTALT,S,exec, grim -g "$(slurp)" $HOME/gits/ost-4semester/Screensho bind=SUPER,D,exec, $HOME/.config/eww/scripts/cockpit_toggle bind=,Print,exec, grim - | wl-copy bind=SUPER,A,exec,copyq toggle +bind=SUPER,Y,exec, $HOME/.config/eww/scripts/monitor.sh extend +bind=SUPER,H,exec, $HOME/.config/eww/scripts/monitor.sh mirror + # bind=SUPERALT,H,pass,^(wlroots)$ # bind=SUPERALT,left,pass,^(wlroots)$ # bind=SUPERALT,right,pass,^(wlroots)$ diff --git a/nvim/lazy-lock.json b/nvim/lazy-lock.json index 8ae0848..3041173 100644 --- a/nvim/lazy-lock.json +++ b/nvim/lazy-lock.json @@ -1,9 +1,9 @@ { - "LazyVim": { "branch": "main", "commit": "3c6357815c354ee2bb82b4162a484c1de6d575dc" }, - "LuaSnip": { "branch": "master", "commit": "9b5be5e9b460fad7134991d3fd0434466959db08" }, - "alpha-nvim": { "branch": "main", "commit": "4b0ba68022d8612b04b26844f1ce5e708c0d23b0" }, + "LazyVim": { "branch": "main", "commit": "8bb0c9ddd85780f1490ba29388449e9ef68a68ae" }, + "LuaSnip": { "branch": "master", "commit": "436857749a905b48c1e8205b996639c28f006556" }, + "alpha-nvim": { "branch": "main", "commit": "4e1c4dedf5983e84b3ed305228b2235c56c7023c" }, "bufferline.nvim": { "branch": "main", "commit": "3677aceb9a72630b0613e56516c8f7151b86f95c" }, - "catppuccin": { "branch": "main", "commit": "5e2c9cf8277c42fb634007126c36d765fd176f4a" }, + "catppuccin": { "branch": "main", "commit": "128af65c3a23c94b324dc8d7f02a34feee8722d4" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, "cmp-nvim-lsp": { "branch": "main", "commit": "0e6b2ed705ddcff9738ec4ea838141654f12eeef" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, @@ -11,57 +11,57 @@ "dressing.nvim": { "branch": "master", "commit": "5f44f829481640be0f96759c965ae22a3bcaf7ce" }, "editorconfig.nvim": { "branch": "master", "commit": "5b9e303e1d6f7abfe616ce4cc8d3fffc554790bf" }, "flit.nvim": { "branch": "main", "commit": "4c1739137acd3e7f03e2065a7be8a4dc41c7e461" }, - "friendly-snippets": { "branch": "main", "commit": "009887b76f15d16f69ae1341f86a7862f61cf2a1" }, - "gitsigns.nvim": { "branch": "main", "commit": "3b6c0a6412b31b91eb26bb8f712562cf7bb1d3be" }, + "friendly-snippets": { "branch": "main", "commit": "2f5b8a41659a19bd602497a35da8d81f1e88f6d9" }, + "gitsigns.nvim": { "branch": "main", "commit": "b1f9cf7c5c5639c006c937fc1819e09f358210fc" }, "harpoon": { "branch": "master", "commit": "f7040fd0c44e7a4010369136547de5604b9c22a1" }, "indent-blankline.nvim": { "branch": "master", "commit": "018bd04d80c9a73d399c1061fa0c3b14a7614399" }, - "lazy.nvim": { "branch": "main", "commit": "14075657131b9a19883a8845c47f1ab65461cd6f" }, - "leap.nvim": { "branch": "main", "commit": "d34680b16af977928228e57c68e5a162f1649e3c" }, + "lazy.nvim": { "branch": "main", "commit": "e27c9df5fe039e9d2833ef4fcf7305595d5ccda7" }, + "leap.nvim": { "branch": "main", "commit": "f74473d23ebf60957e0db3ff8172349a82e5a442" }, "lsp-inlayhints.nvim": { "branch": "main", "commit": "84ca3abe8aaecbb5b30ad89e4701d4a9c821b72c" }, "lualine.nvim": { "branch": "master", "commit": "e99d733e0213ceb8f548ae6551b04ae32e590c80" }, "markdown-preview.nvim": { "branch": "master", "commit": "02cc3874738bc0f86e4b91f09b8a0ac88aef8e96" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "e4badf7984f7a5f0ac7dc10657dbedbd99a82f94" }, - "mason-nvim-dap.nvim": { "branch": "main", "commit": "07fd5396c17eec6d5857039f232d0a03a2b28a5a" }, - "mason.nvim": { "branch": "main", "commit": "c400270804059087e2d0041893a95c6bab4df3c1" }, - "mini.bufremove": { "branch": "main", "commit": "8464390c932556dbb298ccf8a7587d6ef765e94f" }, - "mini.comment": { "branch": "main", "commit": "5e8c7f75c48d958ef84ed75772b0263284c8621d" }, - "mini.indentscope": { "branch": "main", "commit": "7998edc970610c05598c7aea3d21ece8dd87ed52" }, - "mini.pairs": { "branch": "main", "commit": "0256717c9364ad6b5384c37b4f96fb4f7cc74867" }, - "mini.surround": { "branch": "main", "commit": "b7c2f4bea1f60af8dfee71f696319d045d986ce6" }, - "neo-tree.nvim": { "branch": "v2.x", "commit": "aec592bb1f0cf67f7e1123053d1eb17700aa9ed4" }, - "neoconf.nvim": { "branch": "main", "commit": "c2604560ea764ad5f72e52f38c52ef7fc2d1be98" }, - "neodev.nvim": { "branch": "main", "commit": "c6b8ff8f0d261c8fb99a55ec7cc5dcf9cb928293" }, - "noice.nvim": { "branch": "main", "commit": "c22651651da01239fc4afac4cdb7261797d5f02e" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "a81503f0019942111fe464209237f8b4e85f4687" }, + "mason-nvim-dap.nvim": { "branch": "main", "commit": "8c5d0212bb385ce363ac3a00aa2e16d88ac44ba7" }, + "mason.nvim": { "branch": "main", "commit": "87c9453cd91da3bba1076fa578a72439fbc4d311" }, + "mini.bufremove": { "branch": "main", "commit": "68f9111aa81545022bb5afe7d576311a0fc29969" }, + "mini.comment": { "branch": "main", "commit": "f045998636c6fd746297220b8c692bf1e91568cb" }, + "mini.indentscope": { "branch": "main", "commit": "43f6761c9a3e397b7c12b3c72f678bcf61efcfcf" }, + "mini.pairs": { "branch": "main", "commit": "771c08bd313614c7e9a1904d277ac76eb226f674" }, + "mini.surround": { "branch": "main", "commit": "b450a3aff91b4108c0e9ba9e82633d65deb5802b" }, + "neo-tree.nvim": { "branch": "v2.x", "commit": "205184aa0e0f08e8a1249d9bb37b45bae85f01b9" }, + "neoconf.nvim": { "branch": "main", "commit": "48178e12a8b722f36ca9f0e8ff0a5487b45de493" }, + "neodev.nvim": { "branch": "main", "commit": "abdc346ff59c414698de551f876bcf3f223ed224" }, + "noice.nvim": { "branch": "main", "commit": "283eee690dee06422c2681ed2fae072fcfade722" }, "nui.nvim": { "branch": "main", "commit": "0dc148c6ec06577fcf06cbab3b7dac96d48ba6be" }, - "null-ls.nvim": { "branch": "main", "commit": "456cd2754c56c991c5e4df60a807d054c1bc7148" }, + "null-ls.nvim": { "branch": "main", "commit": "09e99259f4cdd929e7fb5487bf9d92426ccf7cc1" }, "nvim-cmp": { "branch": "main", "commit": "feed47fd1da7a1bad2c7dca456ea19c8a5a9823a" }, - "nvim-dap": { "branch": "master", "commit": "c1bfcd89ef440a44d02ade7e71befb1e5aa358ca" }, + "nvim-dap": { "branch": "master", "commit": "73196075627a4f079c62b0dd4aff8ce0a1b7cf57" }, "nvim-dap-ui": { "branch": "master", "commit": "bdb94e3853d11b5ce98ec182e5a3719d5c0ef6fd" }, "nvim-dap-virtual-text": { "branch": "master", "commit": "8db23ea51203b5f00ad107a0cef7e0b2d7a0476c" }, - "nvim-highlight-colors": { "branch": "main", "commit": "af051bfe2971fc888d21cdfc59f5444904353b43" }, - "nvim-jdtls": { "branch": "master", "commit": "db08bfb87300fca2db91d15b64ca88a62970fb58" }, - "nvim-lspconfig": { "branch": "master", "commit": "1a2d5f5224c65b0709bf5da0ccd9cad29272083a" }, + "nvim-highlight-colors": { "branch": "main", "commit": "ce11467796389a4e5838c22384f94c624121796b" }, + "nvim-jdtls": { "branch": "master", "commit": "9fcc9495b5d03f8d50e4af936fd0f905f045a6c2" }, + "nvim-lspconfig": { "branch": "master", "commit": "4bb0f1845c5cc6465aecedc773fc2d619fcd8faf" }, "nvim-navic": { "branch": "master", "commit": "cdd24539bcf114a499827e9b32869fe74836efe7" }, - "nvim-notify": { "branch": "master", "commit": "281e4d793c550c866bea3fb85d39de1f0188fb50" }, - "nvim-spectre": { "branch": "master", "commit": "b71b64afe9fedbfdd25a8abec897ff4af3bd553a" }, - "nvim-treesitter": { "branch": "master", "commit": "980f0816cc28c20e45715687a0a21b5b39af59eb" }, - "nvim-treesitter-textobjects": { "branch": "master", "commit": "4b30081d2736e09f90c890a8a7adfe4df36f5b36" }, + "nvim-notify": { "branch": "master", "commit": "02047199e2752223c77c624160f720ca227944a9" }, + "nvim-spectre": { "branch": "master", "commit": "201ccd1f6ce98a4e509359c8994e111a52a02515" }, + "nvim-treesitter": { "branch": "master", "commit": "cd436f92f65def9c7e74a7324d3eab422ef85643" }, + "nvim-treesitter-textobjects": { "branch": "master", "commit": "5b2bcb9ca8315879181f468b37a897100d631005" }, "nvim-ts-context-commentstring": { "branch": "main", "commit": "729d83ecb990dc2b30272833c213cc6d49ed5214" }, - "nvim-web-devicons": { "branch": "master", "commit": "b2060eac2fbc84e0637ea706378ff66451e7c424" }, + "nvim-web-devicons": { "branch": "master", "commit": "f1b1cee3a561590a6c1637a9326c406f6e4af914" }, "persistence.nvim": { "branch": "main", "commit": "adcf6913693a0434665d162ee45a186230496f8a" }, "plenary.nvim": { "branch": "master", "commit": "253d34830709d690f013daf2853a9d21ad7accab" }, "tailwindcss-colorizer-cmp.nvim": { "branch": "main", "commit": "f044050da3ec6e1cdb31985beecec6810cc27f0b" }, - "telescope-file-browser.nvim": { "branch": "master", "commit": "61b3769065131129716974f7fb63f82ee409bd80" }, + "telescope-file-browser.nvim": { "branch": "master", "commit": "94fe37a1ea217dd2f90d91222bc1531521146ac3" }, "telescope-project.nvim": { "branch": "master", "commit": "8e8ee37b7210761502cdf2c3a82b5ba8fb5b2972" }, "telescope-zoxide": { "branch": "main", "commit": "68966349aa1b8e9ade403e18479ecf79447389a7" }, "telescope.nvim": { "branch": "master", "commit": "a3f17d3baf70df58b9d3544ea30abe52a7a832c2" }, - "todo-comments.nvim": { "branch": "main", "commit": "74c7d28cb50b0713c881ef69bcb6cdd77d8907d1" }, - "toggleterm.nvim": { "branch": "main", "commit": "31d38d11390bcd35a568fcc65a79b7d6ec89de62" }, - "tokyonight.nvim": { "branch": "main", "commit": "a310c1ddb3a7d8b940834238f79f7bfd494ba76a" }, + "todo-comments.nvim": { "branch": "main", "commit": "6ccb0bebeb22dbe31940776a750db54b844ae653" }, + "toggleterm.nvim": { "branch": "main", "commit": "c8e982ad2739eeb0b13d0fecb14820c9bf5e3da0" }, + "tokyonight.nvim": { "branch": "main", "commit": "467d889ba82a74e26821c812aa8e70d7dff04c6c" }, "trouble.nvim": { "branch": "main", "commit": "67337644e38144b444d026b0df2dc5fa0038930f" }, "vim-illuminate": { "branch": "master", "commit": "49062ab1dd8fec91833a69f0a1344223dd59d643" }, "vim-repeat": { "branch": "master", "commit": "24afe922e6a05891756ecf331f39a1f6743d3d5a" }, "vim-startuptime": { "branch": "master", "commit": "6580cf539c33a212f4f5542068a3b4dd2b3ad834" }, - "vimtex": { "branch": "master", "commit": "6f7e507ed1c397838798e43a8249612864c929ba" }, + "vimtex": { "branch": "master", "commit": "c39907f3caad8157b5b5fb628e9d035a8aee7d76" }, "which-key.nvim": { "branch": "main", "commit": "fb027738340502b556c3f43051f113bcaa7e8e63" } } \ No newline at end of file