Advertisement
Guest User

Untitled

a guest
Jul 4th, 2021
107,696
2
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 12.46 KB | None | 2 0
  1. 1. Instalamos los siguientes paquetes:
  2.  
  3. apt install build-essential git vim xcb libxcb-util0-dev libxcb-ewmh-dev libxcb-randr0-dev libxcb-icccm4-dev libxcb-keysyms1-dev libxcb-xinerama0-dev libasound2-dev libxcb-xtest0-dev libxcb-shape0-dev
  4.  
  5. 2. Instalamos bspwm y sxhkd:
  6.  
  7. cd /home/s4vitar/Descargas/
  8. git clone https://github.com/baskerville/bspwm.git
  9. git clone https://github.com/baskerville/sxhkd.git
  10. cd bspwm/
  11. make
  12. sudo make install
  13. cd ../sxhkd/
  14. make
  15. sudo make install
  16.  
  17. sudo apt install bspwm
  18.  
  19. 3. Cargamos en bspwm y sxhkd ficheros de ejemplo:
  20.  
  21. mkdir ~/.config/bspwm
  22. mkdir ~/.config/sxhkd
  23. cd /home/s4vitar/Descargas/bspwm/
  24. cp examples/bspwmrc ~/.config/bspwm/
  25. chmod +x ~/.config/bspwm/bspwmrc
  26. cp examples/sxhkdrc ~/.config/sxhkd/
  27.  
  28. 4. Abrimos el sxhkdrc y configuramos el tipo de terminal así como algunos key bindings:
  29. # ------------------------------------------------------------------------------------------------
  30. #
  31. # wm independent hotkeys
  32. #
  33.  
  34. # terminal emulator
  35. super + Return
  36.     gnome-terminal
  37.  
  38. # program launcher
  39. super + d
  40.     rofi -show run
  41.  
  42. # make sxhkd reload its configuration files:
  43. super + Escape
  44.     pkill -USR1 -x sxhkd
  45.  
  46. #
  47. # bspwm hotkeys
  48. #
  49.  
  50. # quit/restart bspwm
  51. super + alt + {q,r}
  52.     bspc {quit,wm -r}
  53.  
  54. # close and kill
  55. super + {_,shift + }w
  56.     bspc node -{c,k}
  57.  
  58. # alternate between the tiled and monocle layout
  59. super + m
  60.     bspc desktop -l next
  61.  
  62. # send the newest marked node to the newest preselected node
  63. super + y
  64.     bspc node newest.marked.local -n newest.!automatic.local
  65.  
  66. # swap the current node and the biggest node
  67. super + g
  68.     bspc node -s biggest
  69.  
  70. #
  71. # state/flags
  72. #
  73.  
  74. # set the window state
  75. super + {t,shift + t,s,f}
  76.     bspc node -t {tiled,pseudo_tiled,floating,fullscreen}
  77.  
  78. # set the node flags
  79. super + ctrl + {m,x,y,z}
  80.     bspc node -g {marked,locked,sticky,private}
  81.  
  82. #
  83. # focus/swap
  84. #
  85.  
  86. super + {_,shift + }{Left,Down,Up,Right}
  87.        bspc node -{f,s} {west,south,north,east}
  88.  
  89.  
  90. # focus the node for the given path jump
  91. super + {p,b,comma,period}
  92.     bspc node -f @{parent,brother,first,second}
  93.  
  94. # focus the next/previous node in the current desktop
  95. super + {_,shift + }c
  96.     bspc node -f {next,prev}.local
  97.  
  98. # focus the next/previous desktop in the current monitor
  99. super + bracket{left,right}
  100.     bspc desktop -f {prev,next}.local
  101.  
  102. # focus the last node/desktop
  103. super + {grave,Tab}
  104.     bspc {node,desktop} -f last
  105.  
  106. # focus the older or newer node in the focus history
  107. super + {o,i}
  108.     bspc wm -h off; \
  109.     bspc node {older,newer} -f; \
  110.     bspc wm -h on
  111.  
  112. # focus or send to the given desktop
  113. super + {_,shift + }{1-9,0}
  114.     bspc {desktop -f,node -d} '^{1-9,10}'
  115.  
  116. #
  117. # preselect
  118. #
  119.  
  120. # preselect the direction
  121. super + ctrl + alt + {Left,Down,Up,Right}
  122.     bspc node -p {west,south,north,east}
  123.  
  124.  
  125. # preselect the ratio
  126. super + ctrl + {1-9}
  127.     bspc node -o 0.{1-9}
  128.  
  129. # cancel the preselection for the focused node
  130. super + ctrl + space
  131.     bspc node -p cancel
  132.  
  133. # cancel the preselection for the focused desktop
  134. super + ctrl + alt + space
  135.     bspc query -N -d | xargs -I id -n 1 bspc node id -p cancel
  136.  
  137. #
  138. # move/resize
  139. #
  140.  
  141. # expand a window by moving one of its side outward
  142. #super + alt + {h,j,k,l}
  143. #   bspc node -z {left -20 0,bottom 0 20,top 0 -20,right 20 0}
  144.  
  145. # contract a window by moving one of its side inward
  146. #super + alt + shift + {h,j,k,l}
  147. #   bspc node -z {right -20 0,top 0 20,bottom 0 -20,left 20 0}
  148.  
  149. # move a floating window
  150. super + ctrl + {Left,Down,Up,Right}
  151.     bspc node -v {-20 0,0 20,0 -20,20 0}
  152.  
  153. # Custom move/resize
  154. alt + super + {Left,Down,Up,Right}
  155.     /home/s4vitar/.config/bspwm/scripts/bspwm_resize {west,south,north,east}
  156. # ------------------------------------------------------------------------------------------------
  157.  
  158. 5. Creamos el archivo bspwm_resize:
  159.  
  160. mkdir ~/.config/bspwm/scripts/
  161. touch ~/.config/bspwm/scripts/bspwm_resize; chmod +x ~/.config/bspwm/scripts/bspwm_resize
  162.  
  163. Mediante la siguiente configuración podremos en el futuro controlar las dimensiones de las vetanas, así como
  164. modificarlas con atajos de teclado:
  165. # ------------------------------------------------------------------------------------------------
  166. #!/usr/bin/env dash
  167.  
  168. if bspc query -N -n focused.floating > /dev/null; then
  169.     step=20
  170. else
  171.     step=100
  172. fi
  173.  
  174. case "$1" in
  175.     west) dir=right; falldir=left; x="-$step"; y=0;;
  176.     east) dir=right; falldir=left; x="$step"; y=0;;
  177.     north) dir=top; falldir=bottom; x=0; y="-$step";;
  178.     south) dir=top; falldir=bottom; x=0; y="$step";;
  179. esac
  180.  
  181. bspc node -z "$dir" "$x" "$y" || bspc node -z "$falldir" "$x" "$y"
  182. # -------------------------------------------------------------------------------------------------
  183.  
  184. 6. Procedemos a instalar la polybar. Para ello, instalamos primero los siguientes paquetes:
  185.  
  186. sudo apt install cmake cmake-data pkg-config python3-sphinx libcairo2-dev libxcb1-dev libxcb-util0-dev libxcb-randr0-dev libxcb-composite0-dev python3-xcbgen xcb-proto libxcb-image0-dev libxcb-ewmh-dev libxcb-icccm4-dev libxcb-xkb-dev libxcb-xrm-dev libxcb-cursor-dev libasound2-dev libpulse-dev libjsoncpp-dev libmpdclient-dev libcurl4-openssl-dev libnl-genl-3-dev
  187.  
  188. Para instalar la polybar hacemos lo siguiente:
  189.  
  190. cd /home/s4vitar/Descargas/
  191. git clone --recursive https://github.com/polybar/polybar
  192. cd polybar/
  193. mkdir build
  194. cd build/
  195. cmake ..
  196. make -j$(nproc)
  197. sudo make install
  198.  
  199. 7. Procedemos con la instalación de Picom para ajustar las transparencias (Compton ya está deprecated).
  200.  
  201. Primeramente, instalamos los siguientes paquetes, no sin antes actualizar el sistema:
  202.  
  203. sudo apt update
  204. sudo apt install meson libxext-dev libxcb1-dev libxcb-damage0-dev libxcb-xfixes0-dev libxcb-shape0-dev libxcb-render-util0-dev libxcb-render0-dev libxcb-randr0-dev libxcb-composite0-dev libxcb-image0-dev libxcb-present-dev libxcb-xinerama0-dev libpixman-1-dev libdbus-1-dev libconfig-dev libgl1-mesa-dev libpcre2-dev libevdev-dev uthash-dev libev-dev libx11-xcb-dev libxcb-glx0-dev
  205.  
  206. Posteriormente, ejecutamos los siguientes comandos bajo el directorio ~/Descargas:
  207.  
  208. git clone https://github.com/ibhagwan/picom.git
  209. cd picom/
  210. git submodule update --init --recursive
  211. meson --buildtype=release . build
  212. ninja -C build
  213. sudo ninja -C build install
  214.  
  215. 8. Instalamos rofi (Posteriormente instalaremos el tema Nord para Rofi):
  216.  
  217. sudo apt install rofi
  218.  
  219. 9. En este punto, reiniciamos el equipo y seleccionamos bspwm (Probamos que los shortcuts estén funcionando correctamente).
  220.  
  221. 10. Configuramos un poco la terminal e instalamos las Hack Nerd Fonts, además del Firefox (hay que descargarse la última versión, también instalaremos firejail con 'apt install firejail' con el objetivo de lanzar firefox bajo este contexto enjaulado con sxhkd). [Las fuentes de Hack Nerd Fonts deben ir descomprimidas en /usr/local/share/fonts/, una vez hecho hay que ejecutar el comando 'fc-cache -v']
  222.  
  223. 11. Instalamos el addon 'FoxyProxy' para Firefox.
  224.  
  225. 12. Configuramos la privacidad en Firefox y el directorio de descargas principal
  226.  
  227. 13. Instalamos 'feh' con 'apt install feh' para poder cargar fondos de pantalla.
  228.  
  229. 14. Cargamos en el archivo bspwmrc justo al final la siguiente línea:
  230.  
  231. feh --bg-fill /home/s4vitar/Desktop/S4vitar/Images/fondo.jpg
  232.  
  233. 15. Para configurar nuestra Polybar, clonaremos primeramente en 'Descargas' el siguiente repositorio:
  234.  
  235. git clone https://github.com/VaughnValle/blue-sky.git
  236.  
  237. Posteriormente, ejecutaremos los siguientes comandos:
  238.  
  239. mkdir ~/.config/polybar
  240. cd ~/Descargas/blue-sky/polybar/
  241. cp * -r ~/.config/polybar
  242. echo '~/.config/polybar/./launch.sh' >> ~/.config/bspwm/bspwmrc
  243. cd fonts
  244. sudo cp * /usr/share/fonts/truetype/
  245. fc-cache -v
  246.  
  247. Hacemos Windows + Shift + R para cargar la configuración y deberíamos ver la Polybar por arriba.
  248.  
  249. 16. Para configurar Picom y ajustar las transparencias además de bordeados de ventana, ejecutamos los siguientes pasos:
  250.  
  251. mkdir ~/.config/picom
  252. cd ~/.config/picom
  253. cp ~/Descargas/blue-sky/picom.conf .
  254.  
  255. Editamos el archivo picom.conf y cambiamos 'backend = "glx"' por 'backend = "xrender"', comentando el de glx. Posteriormente, comentamos todas las líneas referentes a glx (En algunos ordenadores al dejar el glx puesto se puede llegar a experimentar una lentitud muy molesta).
  256.  
  257. Antes de recargar la configuración, hacemos un seguimiento del ratón para saber en qué ventana estamos con la siguiente instrucción en el 'bspwm':
  258.  
  259. bspc config focus_follows_pointer true
  260.  
  261. Posteriormente, ejecutamos los siguientes comandos para aplicar los bordeados:
  262.  
  263. echo 'picom --experimental-backends &' >> ~/.config/bspwm/bspwmrc
  264. echo 'bspc config border_width 0' >> ~/.config/bspwm/bspwmrc
  265.  
  266. 17. Configuramos los colores de la polybar (paleta central), además de las paletas deseadas.
  267.  
  268. Estructura de un nuevo módulo:
  269.  
  270. Previamente tenemos que crear una carpeta en "~/.config/bin"
  271.  
  272. [module/tumodulo]
  273. type = custom/script
  274. interval = 2
  275. exec = ~/.config/bin/binario.sh
  276.  
  277. Por ejemplo, para el módulo del ethernet_status:
  278.  
  279. #!/bin/sh
  280.  
  281. echo "%{F#2495e7} %{F#ffffff}$(/usr/sbin/ifconfig eth0 | grep "inet " | awk '{print $2}')%{u-}"
  282.  
  283. Para el módulo de hackthebox_status.sh:
  284.  
  285. #!/bin/sh
  286.  
  287. IFACE=$(/usr/sbin/ifconfig | grep tun0 | awk '{print $1}' | tr -d ':')
  288.  
  289. if [ "$IFACE" = "tun0" ]; then
  290.     echo "%{F#1bbf3e} %{F#ffffff}$(/usr/sbin/ifconfig tun0 | grep "inet " | awk '{print $2}')%{u-}"
  291. else
  292.     echo "%{F#1bbf3e}%{u-} Disconnected"
  293. fi
  294.  
  295. 18. Configuramos el tema Nord de Rofi:
  296.  
  297. mkdir -p ~/.config/rofi/themes
  298. cp ~/Descargas/blue-sky/nord.rasi ~/.config/rofi/themes
  299.  
  300. Posteriormente con 'rofi-theme-selector' seleccionamos el tema Nord.
  301.  
  302. 19. Instalamos slim y slimlock
  303.  
  304. Instalamos los siguientes paquetes, no sin antes hacer una actualización:
  305.  
  306. sudo apt update
  307. sudo apt install slim libpam0g-dev libxrandr-dev libfreetype6-dev libimlib2-dev libxft-dev
  308.  
  309. Posteriormente, ejecutamos los siguientes comandos:
  310.  
  311. cd ~/Descargas/
  312. git clone https://github.com/joelburget/slimlock.git
  313. cd slimlock/
  314. sudo make
  315. sudo make install
  316. cd ~/Descargas/blue-sky/slim
  317. sudo cp slim.conf /etc/
  318. sudo cp slimlock.conf /etc
  319. sudo cp -r default /usr/share/slim/themes
  320.  
  321. Si queremos cambiar la imagen del panel, nos vamos a la ruta '/usr/share/slim/themes/default' y retocamos el archivo 'panel.png'.
  322.  
  323. 20. Reiniciamos el sistema y una vez arrancado, incorporamos en el archivo 'bspwmrc' la siguiente línea para arreglar el cursor:
  324.  
  325. xsetroot -cursor_name left_ptr &
  326.  
  327. 21. Instalamos la powerlevel10k en zsh
  328.  
  329. 22. Creamos enlace simbólico de la zshrc para root
  330.  
  331. 23. Cambiamos el tipo de shell por defecto tanto para root como para el usuario con bajos privilegios
  332.  
  333. usermod --shell /usr/bin/zsh tuUsuario
  334. usermod --shell /usr/bin/zsh root
  335.  
  336. 24. Retocamos el archivo .p10k.zsh para adecuarlo a nuestro gusto
  337.  
  338. Para el de root, podemos ir a 'POWERLEVEL9K_CONTEXT_ROOT_TEMPLATE' para asignar el Hashtag.
  339.  
  340. Comentamos la siguiente línea:
  341.  
  342. # POWERLEVEL9K_CONTEXT_PREFIX='%246Fwith '
  343.  
  344. Para evitar un pequeño problema de permisos a la hora de desde el usuario root migrar con 'su' al usuario con bajos privilegios, ejecutamos los siguientes comandos:
  345.  
  346. chown s4vitar:s4vitar /root
  347. chown s4vitar:s4vitar /root/.cache -R
  348. chown s4vitar:s4vitar /root/.local -R
  349.  
  350. 25. Instalamos bat, lsd, fzf y ranger
  351.  
  352. 26. Instalar el plugin sudo
  353.  
  354. 27. Instalamos nvim con el theme nord
  355.  
  356. cd .config/nvim/
  357. wget https://github.com/arcticicestudio/nord-vim/archive/master.zip
  358. unzip master.zip
  359. rm master.zip
  360. mv nord-vim-master/colors/ .
  361. rm -r nord-vim-master/
  362.  
  363. Añadimos al archivo 'init.vim' la línea 'colorscheme nord' justo al final.
  364.  
  365. wget https://raw.githubusercontent.com/Necros1s/lotus/master/lotus.vim
  366. wget https://raw.githubusercontent.com/Necros1s/lotus/master/lotusbar.vim
  367. wget https://raw.githubusercontent.com/Necros1s/lotus/master/init.vim (Quitamos las líneas del plug)
  368.  
  369. Añadimos justo al final del 'init.vim' la línea 'syntax on' para la detección de sintaxis.
  370.  
  371. [TODO ESTE PROCESO HAY QUE HACERLO TAMBIÉN COMO EL USUARIO ROOT]
  372.  
  373. Incorporamos posteriormente las siguientes líneas al final del zshrc para que al salir del nvim no se quede el cursor en modo Block:
  374.  
  375. # Change cursor shape for different vi modes.
  376. function zle-keymap-select {
  377.   if [[ $KEYMAP == vicmd ]] || [[ $1 = 'block' ]]; then
  378.     echo -ne '\e[1 q'
  379.   elif [[ $KEYMAP == main ]] || [[ $KEYMAP == viins ]] || [[ $KEYMAP = '' ]] || [[ $1 = 'beam' ]]; then
  380.     echo -ne '\e[5 q'
  381.   fi
  382. }
  383. zle -N zle-keymap-select
  384.  
  385. # Start with beam shape cursor on zsh startup and after every command.
  386. zle-line-init() { zle-keymap-select 'beam'}
  387.  
  388. 28. Instalamos Oh My Tmux
  389.  
  390. 29. Whichsystem.py
  391.  
  392. https://github.com/Akronox/WichSystem.py
  393.  
  394. 30. fastTCPScan.go
  395.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement