diff --git a/modules/core/tty.nix b/modules/core/tty.nix index c2d7fdd..1e0bcc0 100644 --- a/modules/core/tty.nix +++ b/modules/core/tty.nix @@ -17,6 +17,7 @@ df = "df -h"; du = "du -h"; }; + # Defined in /etc/set-environnement. Require session restart variables = { XDG_CONFIG_HOME = "$HOME/.config"; XDG_CACHE_HOME = "$HOME/.cache"; @@ -39,16 +40,6 @@ setOptions = [ "SHARE_HISTORY" ]; - # shellInit = '' - # export XDG_CONFIG_HOME=$HOME/.config - # export XDG_CACHE_HOME=$HOME/.cache - # export XDG_DATA_HOME=$HOME/.local/share - # export ZDOTDIR=$HOME/.config/zsh - # export TERMINAL=kitty - # export EDITOR=nvim - # export BROWSER=firefox - # export SAVEHIST=200000 - # ''; promptInit = '' stty stop undef # Disable ctrl+s to freeze terminal diff --git a/modules/optionnals/desktop/config/etc/xdg/hypr/hyprland.conf b/modules/optionnals/desktop/config/etc/xdg/hypr/hyprland.conf index c80cd6e..1ae5860 100644 --- a/modules/optionnals/desktop/config/etc/xdg/hypr/hyprland.conf +++ b/modules/optionnals/desktop/config/etc/xdg/hypr/hyprland.conf @@ -14,7 +14,6 @@ ecosystem { ################### $terminal = kitty -source = /etc/xdg/hypr/rofi.conf ################# ### AUTOSTART ### @@ -211,9 +210,10 @@ device { $mainMod = SUPER # Sets "Windows" key as main modifier # Apps shortcut -bind = $mainMod, D, exec, $rofi +bind = $mainMod, D, exec, rofi -show drun -show-icons -config /etc/xdg/rofi/config.rasi bind = $mainMod, L, exec, /etc/xdg/scripts/wayland-disconnect.sh bind = $mainMod, M, exec, /etc/xdg/scripts/wayland-mpv.sh +bind = $mainMod, K, exec, /etc/xdg/scripts/rofi-ssh.sh bind = $mainMod SHIFT, P, exec, pavucontrol bind = $mainMod SHIFT, T, exec, teams-for-linux bind = $mainMod SHIFT, D, exec, discord diff --git a/modules/optionnals/desktop/config/etc/xdg/rofi/mpv.rasi b/modules/optionnals/desktop/config/etc/xdg/rofi/mpv.rasi new file mode 100644 index 0000000..e28db7c --- /dev/null +++ b/modules/optionnals/desktop/config/etc/xdg/rofi/mpv.rasi @@ -0,0 +1,16 @@ +@import "launcher.rasi" +window { + width: 50%; + height: 50%; + margin: 0px; + location: center; + anchor: center; +} + +mainbox { + children: [inputbar,listview]; +} + +listview { + columns: 1; +} \ No newline at end of file diff --git a/modules/optionnals/desktop/config/etc/xdg/rofi/ssh.rasi b/modules/optionnals/desktop/config/etc/xdg/rofi/ssh.rasi new file mode 100644 index 0000000..ce30d9e --- /dev/null +++ b/modules/optionnals/desktop/config/etc/xdg/rofi/ssh.rasi @@ -0,0 +1,12 @@ +@import "launcher.rasi" +window { + width: 50%; + height: 50%; + margin: 0px; + location: center; + anchor: center; +} + +mainbox { + children: [inputbar,listview]; +} \ No newline at end of file diff --git a/modules/optionnals/desktop/config/etc/xdg/scripts/rofi-ssh.sh b/modules/optionnals/desktop/config/etc/xdg/scripts/rofi-ssh.sh new file mode 100755 index 0000000..de69564 --- /dev/null +++ b/modules/optionnals/desktop/config/etc/xdg/scripts/rofi-ssh.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +selected=$(cat ~/.config/zsh/.zsh_history | sed 's/^[ ]*[0-9]*[ ]*//' | grep '^ssh ' | rofi -dmenu -i -theme /etc/xdg/rofi/ssh.rasi -p SSH) + +if [[ -n "$selected" ]]; then + kitty -e $selected +fi \ No newline at end of file diff --git a/modules/optionnals/desktop/config/etc/xdg/scripts/waybar-mailbox.sh b/modules/optionnals/desktop/config/etc/xdg/scripts/waybar-mailbox.sh new file mode 100755 index 0000000..08473f8 --- /dev/null +++ b/modules/optionnals/desktop/config/etc/xdg/scripts/waybar-mailbox.sh @@ -0,0 +1,26 @@ +#!/usr/bin/env bash + +_USER=beastie +_PASSWD='}q6658JD~{}{oiRWsb~Q{P@SV=Qsy,ae' +_SERVER=unixyourbrain.org +_FOLDER=Admin + +set -e + +cd -- "$(dirname -- "$0")" +_DIRNAME="$(pwd)" + +### Sourcer à partir des secrets +#source ~/.config/polybar/imap_creds + + +_COUNT=$(curl -u "$_USER:$_PASSWD" "imaps://$_SERVER" -X "STATUS $_FOLDER (UNSEEN)" 2>/dev/null | \ + sed -e 's/)\r//' -e 's/.*UNSEEN //') + +_UNSEEN=$(curl -u "$_USER:$_PASSWD" "imaps://$_SERVER/$_FOLDER" -X "SEARCH UNSEEN" 2>/dev/null | \ + sed -e "s|\\r||" -e "s|* SEARCH ||" -e "s| |,|g") + +_MAILS=$(curl -v -u "$_USER:$_PASSWD" "imaps://$_SERVER/$_FOLDER" -X "FETCH $_UNSEEN BODY.PEEK[HEADER.FIELDS (From Subject)]" 2>&1 | \ + sed -e "s|\\r||" | awk '/< Subject|< From/ {sub(/^< /, ""); printf "%s\\n", $0}') + +printf '{"text": "%s ", "tooltip": "%s"}' "$_COUNT" "$_MAILS" \ No newline at end of file diff --git a/modules/optionnals/desktop/config/etc/xdg/scripts/update.sh b/modules/optionnals/desktop/config/etc/xdg/scripts/waybar-update.sh similarity index 100% rename from modules/optionnals/desktop/config/etc/xdg/scripts/update.sh rename to modules/optionnals/desktop/config/etc/xdg/scripts/waybar-update.sh diff --git a/modules/optionnals/desktop/config/etc/xdg/scripts/wayland-disconnect.sh b/modules/optionnals/desktop/config/etc/xdg/scripts/wayland-disconnect.sh new file mode 100755 index 0000000..39d08f3 --- /dev/null +++ b/modules/optionnals/desktop/config/etc/xdg/scripts/wayland-disconnect.sh @@ -0,0 +1,31 @@ +#!/usr/bin/env bash + +selected=$(printf "Lock\0icon\x1fsystem-lock-screen +Update\0icon\x1fsystem-software-update +Shutdown\0icon\x1fsystem-shutdown +Reboot\0icon\x1fsystem-reboot +Exit hyprland\0icon\x1fsystem-log-out +Reload hyprland\0icon\x1fsystem-log-out" | rofi -dmenu -show-icons -i -theme /etc/xdg/rofi/disconnect.rasi -p System) + +echo "$selected" + +case $selected in + "Lock") + /nix/store/4pwvyyjrc7frwkycbszakd7z6nf44qgv-hyprlock-0.9.2/bin/hyprlock + ;; + "Update") + kitty /usr/local/share/dotfiles/scripts/update.sh + ;; + "Shutdown") + systemctl poweroff + ;; + "Reboot") + reboot + ;; + "Exit hyprland") + hyprctl dispatch exit + ;; + "Reload hyprland") + hyprctl reload + ;; +esac \ No newline at end of file diff --git a/modules/optionnals/desktop/config/etc/xdg/scripts/wayland-mpv.sh b/modules/optionnals/desktop/config/etc/xdg/scripts/wayland-mpv.sh new file mode 100755 index 0000000..4e3c98b --- /dev/null +++ b/modules/optionnals/desktop/config/etc/xdg/scripts/wayland-mpv.sh @@ -0,0 +1,31 @@ +#!/usr/bin/env bash + +cd -- "$(dirname -- "$0")" || exit + +## if not $1 +if [[ -z $1 ]] +then + _LINES=$(curl "http://10.0.0.1:2013" 2>/dev/null | sed -e "s|.*/dev/null | sed -e "s|.*/dev/null | sed -e "s|.*/dev/null | sed -e "s|.*