Skip to content

Instantly share code, notes, and snippets.

@tyjak
tyjak / popup
Last active June 19, 2019 16:24
popup pour i3 manager
#!/bin/sh
# popup
# wrapper to create popup window in i3w
# dependancies: i3w, termite
# add this in your i3 config file :
# set $wfM_height 600
# set $wfM_width 1000
# for_window [class="w_float-notitle-medium-sticky"] border 1pixel, floating enable, resize set $wfL_width $wfL_height, move position center, sticky enable
# for_window [class="w_float-notitle-medium"] border 1pixel, floating enable, resize set $wfL_width $wfL_height, move position center

Étapes de création d'une règle de financement

  1. Rédaction simple de la règle [métier]

  2. Lecture par le métier et le développeur de la règle [métier, développeur]

  3. Mise en forme de la règle selon la convention de trèfle

  • ajout de la règle dans les fichiers appropriés: [développeur]
  • Un répertoire national, et un fichier pour chaque règle nationale
@tyjak
tyjak / workspace
Last active March 28, 2020 22:12
i3wm move terminal to a workspace based on current path
#!/bin/sh
# command to move terminal in a workspace
# useful in conjonction with direnv
# when you change to directory that have a .envrc with the workspace command, the
# terminal automove to the predifined workspace specified in the .envrc
# how to use: simply put `workspace {name of the workspace}"` in the .envrc file !!!
i3-msg "move --no-auto-back-and-forth container to workspace $1; workspace --no-auto-back-and-forth $1"
#!/bin/sh
# to search something with duckduckgo on vimb
#!/bin/bash
search=`dmenu -nb '#859900' -nf '#eee8d5' -sb '#cb4b16' -fn 'MesloLGSDZ Nerd Font-10' -h 36 -p "DuckDuckGo:"`
echo $search
if [ ! -z "$search" ]; then
search=`jq -nr --arg v "$search" '$v|@uri'`
vimb https://duckduckgo.com/html/?q=$search
fi
@tyjak
tyjak / dmenu-ssh
Last active October 6, 2023 06:53
dmenu-ssh simple dmenu to connect to your ssh server listed in .ssh/config file
#!/bin/sh
# Dmenu for ssh connection
# Take two ssh config files, the default user and a config file for work serveur via $SSH_WORK_CONFIG_FILE
hosts_menu=$(grep '^Host\b [^*]\+\b' $HOME/.ssh/config $SSH_WORK_CONFIG_FILE | awk '{$1=""; print $0}' | dmenu -p "SSH servers:" -l 10 -i -nb '#b58900' -nf '#eee8d5' -sb '#002b24' -fn 'MesloLGSDZ Nerd Font-10' -h ${DMENUHEIGHT:-36})
host_target=$(echo $hosts_menu | cut -d' ' -f1)
unset SSH_AGENT_PID
if [ "${gnupg_SSH_AUTH_SOCK_by:-0}" -ne $$ ]; then
@tyjak
tyjak / popup
Last active March 12, 2025 11:42
window
#!/bin/sh
#set -e
#set -u
#set -o pipefail
export LC_ALL=C
POPUP_DEFAULT_WIDTH=800
POPUP_DEFAULT_HEIGHT=600
# TODO refacto
<?xml version="1.0" ?>
<!DOCTYPE service-group SYSTEM 'avahi-service.dtd'>
<service-group>
<name replace-wildcards="yes">AirPrint HL-2030 @ %h</name>
<service>
<type>_ipp._tcp</type>
<subtype>_universal._sub._ipp._tcp</subtype>
<port>631</port>
<txt-record>txtvers=1</txt-record>
<txt-record>qtotal=1</txt-record>
@tyjak
tyjak / dmenu-webnav
Last active October 7, 2020 12:16
Dmenu to search web history or bookmark or default search engine with vimb
#!/bin/sh
# dmenu scripts to search in history and bookmark or in default vimb search engine
# mark the window where searched was launch
i3-msg 'mark websearch'
# go to web marked if possible
i3-msg '[con_mark="web"] focus'
@tyjak
tyjak / agnoster.zsh-theme
Last active October 11, 2020 12:46
customize prompt option for oh-my-zsh agnoster theme
# vim:ft=zsh ts=2 sw=2 sts=2
# Gist: 9f9569d9fc118c88ad3a758fc2b26502
#
# agnoster's Theme - https://gist.github.com/3712874
# A Powerline-inspired theme for ZSH
#
# # README
#
# In order for this theme to render correctly, you will need a
# [Powerline-patched font](https://gist.github.com/1595572).
@tyjak
tyjak / passgenvimb
Last active November 17, 2020 21:35
Autofill password field on vimb with the password from pasword-store
#!/bin/sh
# Desccription: autofill password field on vimb with the password from pasword-store
# Dependencies: password-store, vimb
# Installation:
# 1. copy this file in you local bin : ~/.local/bin
# 2. add this line in your vimb conf : nmap ,,; ::sh! ~/.local/bin/passgenvimb<CR>
# Last rev: 18-10-2020
# License: WTFPL
# GistID: 52f7443b52fce7270066095101c93099