Skip to content

Instantly share code, notes, and snippets.

@maikelthedev
Created January 22, 2024 18:58
Show Gist options
  • Save maikelthedev/b15c5218c83de0ace3ac7937499900c7 to your computer and use it in GitHub Desktop.
Save maikelthedev/b15c5218c83de0ace3ac7937499900c7 to your computer and use it in GitHub Desktop.
Dotfiles
#!/usr/bin/fish
set options_array "browser" "v-ter" "h-ter" "netflix" "whatsapp" "ssh" "layouts" "kill"
set options (string join "\n" $options_array)
set run (echo -e $options | rofi -p "menu" -dmenu -l 8 -width 15 -monitor -3)
function ssh_menu
set servers (cat .ssh/config | grep "Host " | cut -d" " -f2 | grep -v git | grep -v bitbucket)
set total (echo $servers | wc -w)
set options (echo -e "$servers" | rofi -p 'ssh' -dmenu -l $total -width 15 -monitor -3)
switch "$options"
case "Quit Menu"
echo "Do nothing"
;;
"*"
i3-sensible-terminal -- ssh $options
end
end
function layouts_menu
set layouts (ls ~/.config/regolith2/i3/layouts/ | grep .sh | cut -f1 -d.)
set total (echo $layouts | wc -w)
set selected (echo -e "$layouts" | rofi -p 'layouts' -dmenu -l $total -width 25 -monitor -3)
exec bash ~/.config/regolith2/i3/layouts/$selected.sh
end
switch "$run"
case "whatsapp"
firefox --kiosk=https://web.whatsapp.com
;;
case "browser"
firefox --kiosk=https://www.duckduckgo.com
;;
case "v-ter"
i3-msg splitv; and i3-sensible-terminal
;;
case "h-ter"
i3-msg splith; and i3-sensible-terminal
;;
case "layouts"
layouts_menu
;;
case "netflix"
firefox --kiosk=https://www.netflix.com
;;
case "ssh"
ssh_menu
;;
case "kill"
wmctrl -ic (xdotool getwindowfocus)
;;
case "*"
echo default option
end
#!/bin/bash
windows="$(wmctrl -l|awk '{ if ($2 == "'$(wmctrl -d | awk '{ if ($2 == "'*'") print $1 }')'") print $1}')"
i3-msg append_layout ~/.config/i3/layouts/netflix.json
for window in $windows; do
xdotool windowunmap $window
xdotool windowmap $window
done
{
"border": "pixel",
"floating": "auto_off",
"layout": "splitv",
"percent": 0.5,
"type": "con",
"nodes": [
{
"border": "pixel",
"current_border_width": 1,
"floating": "auto_off",
"name": "i3-save-tree /home/maikel",
"percent": 0.5,
"type": "con",
"layout": "tabbed",
"nodes": [
{
"border": "pixel",
"current_border_width": 1,
"floating": "auto_off",
"name": "Netflix",
"swallows": [
{
"class": "^Chromium$"
}
],
"type": "con"
},
{
"border": "pixel",
"current_border_width": 1,
"floating": "auto_off",
"name": "fish /home/maikel",
"swallows": [
{
"class": "^Xfce4\\-terminal$"
}
],
"type": "con"
}
]
},
{
"border": "pixel",
"floating": "auto_off",
"layout": "splith",
"percent": 0.5,
"type": "con",
"nodes": [
{
"border": "pixel",
"current_border_width": 1,
"floating": "auto_off",
"name": "Netflix",
"percent": 0.6298828125,
"swallows": [
{
"class": "^Chromium$"
}
],
"type": "con"
},
{
"border": "pixel",
"current_border_width": 1,
"floating": "auto_off",
"name": "fish /home/maikel",
"percent": 0.3701171875,
"swallows": [
{
"class": "^Xfce4\\-terminal$"
}
],
"type": "con"
}
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment