diff --git a/.config/emacs/desktop.org b/.config/emacs/desktop.org new file mode 100644 index 0000000..cc58dd6 --- /dev/null +++ b/.config/emacs/desktop.org @@ -0,0 +1,202 @@ +#+TITLE: Desktop + +* Exwm Desktop +#+begin_src config +[Desktop Entry] +Name=EXWM +Comment=Emacs Window Manager +Exec=sh /home/jaeus/.config/emacs/exwm/start-exwm.sh +TryExec=sh +Type=Application +X-LightDM-DesktopName=exwm +DesktopNames=exwm +#+end_src + +#+begin_src shell + #!/bin/sh + # Fire it up for WSL + source ~/scripts/wsl_get_display.sh + picom -b --config $HOME/.xmonad/scripts/picom.conf & + exec dbus-launch --exit-with-session emacs -mm --debug-init -l ~/.config/emacs/desktop.el +#+end_src + + +* Configuration + +** EXWM +#+begin_src emacs-lisp :tangle ~/.config/emacs/desktop.el + + (defun efs/run-in-background (command) + (let ((command-parts (split-string command "[ ]+"))) + (apply #'call-process `(,(car command-parts) nil 0 nil ,@(cdr command-parts))))) + (defun vifon/exwm-terminal () + (interactive) + (let ((default-directory (if (derived-mode-p 'dired-mode) + (dired-current-directory) + default-directory))) + (start-process "alacritty" nil "alacritty"))) + (defun efs/exwm-init-hook () + ;; Make workspace 1 be the one where we land at startup + (exwm-workspace-switch-create 1) + ;;(efs/start-panel) + ;; if not wsl + ;;(efs/run-in-background "xsetroot -cursor_name left_ptr") + ;;(efs/run-in-background "nm-applet") + ;;(efs/run-in-background "pamac-tray") + ;;(efs/run-in-background "volumeicon") + ;;(efs/run-in-background "numlockx on") + ;;(efs/run-in-background "blueberry-tray") + ;;(efs/run-in-background "enpass -minimize") + + ;; Launch apps that will run in the background + ;;(efs/run-in-background "fcitx")) + ) + + (defun efs/exwm-update-class () + (exwm-workspace-rename-buffer exwm-class-name)) + + (defun efs/exwm-update-title () + (pcase exwm-class-name + ("Firefox" (exwm-workspace-rename-buffer (format "Firefox: %s" exwm-title))))) + + ;; This function isn't currently used, only serves as an example how to + ;; position a window + (defun efs/position-window () + (let* ((pos (frame-position)) + (pos-x (car pos)) + (pos-y (cdr pos))) + + (exwm-floating-move (- pos-x) (- pos-y)))) + (use-package exwm + :ensure t) + + ;;(use-package exwm + ;; :config + ;; ;; Set the default number of workspaces + ;; (setq exwm-workspace-number 10) + + ;; ;; When window "class" updates, use it to set the buffer name + ;; (add-hook 'exwm-update-class-hook #'efs/exwm-update-class) + + ;; ;; When window title updates, use it to set the buffer name + ;; (add-hook 'exwm-update-title-hook #'efs/exwm-update-title) + + ;; ;; Configure windows as they're created + ;; ;;(add-hook 'exwm-manage-finish-hook #'efs/configure-window-by-class) + + ;; ;; When EXWM starts up, do some extra confifuration + ;; (add-hook 'exwm-init-hook #'efs/exwm-init-hook) + + ;; ;; Automatically send the mouse cursor to the selected workspace's display + ;; (setq exwm-workspace-warp-cursor t) + + ;; ;; Window focus should follow the mouse pointer + ;; (setq mouse-autoselect-window t + ;; focus-follows-mouse t) + + ;; (add-hook 'exwm-floating-setup-hook + ;; (lambda () + ;; (exwm-layout-hide-mode-line))) + + ;; ;; These keys should always pass through to Emacs + ;; (setq exwm-input-prefix-keys + ;; '(?\C-x + ;; ?\C-u + ;; ?\C-h + ;; ?\M-x + ;; ?\M-` + ;; ?\M-& + ;; ?\M-: + ;; ?\C-\M-j ;; Buffer list + ;; ?\C-\ )) ;; Ctrl+Space + + ;; ;; Ctrl+Q will enable the next key to be sent directly + ;; (define-key exwm-mode-map [?\C-q] 'exwm-input-send-next-key) + + ;; ;; Set up global key bindings. These always work, no matter the input state! + ;; ;; Keep in mind that changing this list after EXWM initializes has no effect. + ;; (setq exwm-input-global-keys + ;; `( + ;; ;; Reset to line-mode (C-c C-k switches to char-mode via exwm-input-release-keyboard) + ;; ([?\s-r] . exwm-reset) + + ;; ;; Move between windows + ;; ([?\s-h] . windmove-left) + ;; ([?\s-l] . windmove-right) + ;; ([?\s-k] . windmove-up) + ;; ([?\s-j] . windmove-down) + + ;; ;;([s-space] . toggle-frame-fullscreen) + ;; ([?\s-f] . exwm-floating-toggle-floating) + + ;; ;; Launch applications via shell command + ;; ([?\s-&] . (lambda (command) + ;; (interactive (list (read-shell-command "$ "))) + ;; (start-process-shell-command command nil command))) + + ;; ([?\s-C] . (lambda () (interactive) (kill-buffer))) + + ;; ;; App + ;; (,(kbd "") . vifon/exwm-terminal) + ;; (,(kbd "") . app-launcher-run-app) + ;; ;; Switch workspace + ;; ([?\s-w] . exwm-workspace-switch) + ;; ([?\s-`] . (lambda () (interactive) (exwm-workspace-switch-create 0))) + + ;; ;; 's-N': Switch to certain workspace with Super (Win) plus a number key (0 - 9) + ;; ,@(mapcar (lambda (i) + ;; `(,(kbd (format "s-%d" i)) . + ;; (lambda () + ;; (interactive) + ;; (exwm-workspace-switch-create ,i)))) + ;; (number-sequence 0 9)))) + + ;; (exwm-enable)) + + ;; if not wsl + ;;(use-package desktop-environment + ;; :after exwm + ;; :config (desktop-environment-mode) + ;; :custom + ;; (desktop-environment-brightness-small-increment "2%+") + ;; (desktop-environment-brightness-small-decrement "2%-") + ;; (desktop-environment-brightness-normal-increment "5%+") + ;; (desktop-environment-brightness-normal-decrement "5%-")) + + ;; Make sure the server is started (better to do this in your main Emacs config!) + (server-start) + +#+end_src +** Polybar +#+begin_src emacs-lisp + ;;:tangle ~/.config/emacs/desktop.el + + (defvar efs/polybar-process nil + "Holds the process of the running Polybar instance, if any") + + (defun efs/kill-panel () + (interactive) + (when efs/polybar-process + (ignore-errors + (kill-process efs/polybar-process))) + (setq efs/polybar-process nil)) + + (defun efs/start-panel () + (interactive) + (efs/kill-panel) + (setq efs/polybar-process (start-process-shell-command "polybar" nil "polybar panel"))) + + (defun efs/send-polybar-hook (module-name hook-index) + (start-process-shell-command "polybar-msg" nil (format "polybar-msg hook %s %s" module-name hook-index))) + + (defun efs/send-polybar-exwm-workspace () + (efs/send-polybar-hook "exwm-workspace" 1)) + + ;; Update panel indicator when workspace changes + (add-hook 'exwm-workspace-switch-hook #'efs/send-polybar-exwm-workspace) +#+end_src +** App Launcher +#+begin_src emacs-lisp :tangle ~/.config/emacs/desktop.el + (straight-use-package + '(app-launcher :type git :host github :repo "SebastienWae/app-launcher")) +#+end_src diff --git a/.xmonad/scripts/autostart.sh b/.xmonad/scripts/autostart.sh index 3249139..ef1a964 100755 --- a/.xmonad/scripts/autostart.sh +++ b/.xmonad/scripts/autostart.sh @@ -15,26 +15,27 @@ xsetroot -cursor_name left_ptr & # background #feh --bg-fill /usr/share/backgrounds/arcolinux/arco-wallpaper.jpg & #dwall -p -s firewatch +source ~/scripts/wsl_get_display.sh ~/scripts/random_wallpaper.sh # other apps #run variety & -run nm-applet & +#run nm-applet & #run pamac-tray & #run xfce4-power-manager & -run volumeicon & +#run volumeicon & #run bitwarden-desktop & #numlockx on & #blueberry-tray & -run lxsession & +#run lxsession & -fcitx & +#fcitx & picom -b --config $HOME/.xmonad/scripts/picom.conf & #/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 & #/usr/lib/xfce4/notifyd/xfce4-notifyd & #seadrive-gui & -emacs --daemon & +#emacs --daemon & -sleep 2 -trayer --edge top --align right --widthtype request --padding 6 --SetDockType true --SetPartialStrut true --expand true --monitor 0 --transparent true --alpha 0 --tint 0x282c34 --height 16 & +#sleep 2 +#trayer --edge top --align right --widthtype request --padding 6 --SetDockType true --SetPartialStrut true --expand true --monitor 0 --transparent true --alpha 0 --tint 0x282c34 --height 16 & diff --git a/.zshrc b/.zshrc index 09763db..5599eb0 100644 --- a/.zshrc +++ b/.zshrc @@ -7,8 +7,7 @@ source $ZSH_CUSTOM/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh source $ZSH_CUSTOM/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh ##WSL2 -#VETHER_IP=$(/bin/grep nameserver /etc/resolv.conf 2> /dev/null | /bin/tr -s ' ' | /bin/cut -d' ' -f2) -#export DISPLAY=$VETHER_IP:10.0 +source ~/scripts/wsl_get_display.sh # emacs alias emd="emacs --daemon" diff --git a/scripts/init_script_arcolinux.sh b/scripts/init_script_arcolinux.sh index 8e52462..f14d60b 100755 --- a/scripts/init_script_arcolinux.sh +++ b/scripts/init_script_arcolinux.sh @@ -11,8 +11,9 @@ stow . #ZSH -paru -S zsh-autosuggestions-git --noconfirm -/usr/share/oh-my-zsh/tools/install.sh +sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" +git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting +git clone https://github.com/zsh-users/zsh-autosuggestions.git ~/.oh-my-zsh/custom/plugins/zsh-autosuggestions mv ~/.zshrc.pre-oh-my-zsh ~/.zshrc # NUSHELL @@ -29,7 +30,6 @@ mv ~/.zshrc.pre-oh-my-zsh ~/.zshrc paru -S neovim --noconfirm sh -c 'curl -fLo "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload/plug.vim --create-dirs \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim' - nvim +PlugInstall +q +q # git config @@ -40,42 +40,30 @@ git config --global user.autocrlf input # tmux paru -S tmux --noconfirm git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm - TMUX_PLUGIN_MANAGER_PATH=~/.config/tmux/plugins/tpm ~/.tmux/plugins/tpm/scripts/install_plugins.sh TMUX_PLUGIN_MANAGER_PATH=~/.config/tmux/plugins/tpm ~/.tmux/plugins/tpm/bin/update_plugins all -# Dynamic wallpaper -sudo pip install pywal -paru -S cronie --noconfirm -sudo systemctl enable cronie -crontab - e -# 0 * * * * /home/jaeus/scripts/random_wallpaper.sh - - # font -paru -S ttf-fira-code ttf-nanum nerd-fonts-mononoki ttf-monaco ttf-d2coding --noconfirm +paru -S ttf-firacode-nerd ttf-nanum ttf-mononoki-nerd --noconfirm # hangul paru -S fcitx-hangul fcitx-configtool --noconfirm # enpass #paru -S enpass --noconfirm -paru -S bitwarden --noconfirm - +#paru -S bitwarden --noconfirm #paru -S green-tunnel --noconfirm #emacs paru -S ripgrep emacs --noconfirm -paru -S auctex texlive-most texlive-lang --noconfirm -paru -S jupyter --noconfirm +paru -S texlive-most texlive-lang --noconfirm +paru -S jupyterlab --noconfirm paru -S zathura zathura-cb zathura-pdf-mupdf #syncthing paru -S syncthing --noconfirm mkdir SyncThing - sudo systemctl enable syncthing@jaeus.service # etc paru -S figlet --noconfirm - diff --git a/scripts/init_script_ubuntu.sh b/scripts/init_script_ubuntu.sh index 2f5e38a..278a13a 100644 --- a/scripts/init_script_ubuntu.sh +++ b/scripts/init_script_ubuntu.sh @@ -12,7 +12,7 @@ cd ~/.dotfiles stow . # ZSH -sudo apt install zsh figet +sudo apt install zsh figlet curl sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting git clone https://github.com/zsh-users/zsh-autosuggestions.git ~/.oh-my-zsh/custom/plugins/zsh-autosuggestions diff --git a/scripts/random_wallpaper.sh b/scripts/random_wallpaper.sh index 49aac45..c85d274 100755 --- a/scripts/random_wallpaper.sh +++ b/scripts/random_wallpaper.sh @@ -1,19 +1,14 @@ #!/bin/bash #wal_dir=~/ShareDirectory/wallpaper/idol/landscape/karina #wal_dir=~/ShareDirectory/wallpaper/idol/portrait/karina -wal_dir=~/ShareDirectory/wallpaper/normal - -# for wsl -export DISPLAY=192.168.144.1:10.0 +wal_dir=~/walls/normal # random wallpaper files=() while IFS= read -r -d $'\0'; do - files+=("$REPLY") + files+=("$REPLY") done < <(find $wal_dir -type f -name "*" -print0) randomfile=$(printf "%s\n" "${files[RANDOM % ${#files[@]}]}") echo $randomfile -wal -i $randomfile --saturate 1.0 -#feh --bg-fill $randomfile - - +#wal -i $randomfile --saturate 1.0 +feh --bg-fill $randomfile diff --git a/scripts/wsl_get_display.sh b/scripts/wsl_get_display.sh new file mode 100644 index 0000000..9c59200 --- /dev/null +++ b/scripts/wsl_get_display.sh @@ -0,0 +1,3 @@ +#!/bin/sh +VETHER_IP=$(/bin/grep nameserver /etc/resolv.conf 2> /dev/null | /bin/tr -s ' ' | /bin/cut -d' ' -f2) +export DISPLAY=$VETHER_IP:10.0