Skip to content

Instantly share code, notes, and snippets.

View naranyala's full-sized avatar
🎯
F11 - back to the context

FMH (@gema_naranyala) naranyala

🎯
F11 - back to the context
View GitHub Profile
@naranyala
naranyala / tmux-fzf-script-runner.sh
Last active November 11, 2023 09:29
tmux global searchbar, inspired by rofi/dmenu global searchbar
#!/bin/bash
# example keybind inside '.tmux.conf'
# bind-key " " display-popup -E "$HOME/bin/tmux-fzf-script-runner.sh"
declare -A list
list["001"]="say hello"
list["002"]="toggle zenmode"
list["003"]="show clock"
-- EXAMPEL KEYBIND
-- vim.api.nvim_exec([[silent! unmap <leader><leader>]], true)
-- vim.api.nvim_set_keymap("n", "<leader><leader>", "<cmd>lua require('naranyala.global-search').action_search()<CR>", {
-- desc = "NEOVIM GLOBAL MENU",
-- noremap = true,
-- silent = true,
-- })
local actions = require("telescope.actions")
local actions_state = require("telescope.actions.state")
#!/bin/bash
declare -A cloud
cloud["gdrive"]="https://drive.google.com/drive/home"
cloud["mega"]="https://mega.nz/fm/dwsUkKBA"
cloud["dropbox"]="https://www.dropbox.com/home"
cloud["onedrive"]="https://onedrive.live.com"
selected_cloud=$(
@naranyala
naranyala / install-appimage-package.sh
Created November 14, 2023 10:05
create a shell alias like "alias install-appimage='$HOME/bin/the-script.sh'" to execute wherever the current directory path is
#!/bin/bash
# Check if the AppImage file path is provided
if [ -z "$1" ]; then
echo "Error: Please provide the path to the AppImage file as the first argument."
exit 1
fi
# Path to the AppImage file
appimage_path="$1"
#!/bin/bash
# Prompt the user to choose a DNS server
echo "Choose a DNS server:"
echo "1. Cloudflare (1.1.1.1)"
echo "2. Google (8.8.8.8)"
read -p "Enter your choice (1 or 2): " choice
# Set the DNS server based on user's choice
case $choice in
vim.cmd([[
autocmd VimEnter,BufWinEnter,BufNewFile,CursorMoved,BufEnter * set showtabline=0
autocmd WinEnter,FocusGained * set showtabline=0
autocmd BufLeave * set showtabline=2
]])
#!/bin/bash
# Script to switch tmux sessions using fzf
# Get a list of active tmux sessions (excluding the current session)
session_list=$(tmux list-sessions | sed -E 's/:.*$//' | grep -v "^$(tmux display-message -p '#S')\$")
# Check if there are no active sessions
if [ -z "$session_list" ]; then
echo "No other active tmux sessions found."
#!/bin/bash
# INFO:
# using fzf to show jump between tmux-window
# Get a list of active tmux sessions
tmux_sessions=$(tmux list-sessions -F "#S")
# Check if there are no active sessions
if [ -z "$tmux_sessions" ]; then
#!/bin/bash
# INFO:
# using fzf to show tmux-session-list
# select and kill the selected-session
# Get a list of active tmux sessions
tmux_list=$(tmux list-sessions -F "#S")
# Check if there are no active sessions
#!/bin/bash
# INFO:
# using fzf to show tmux-window-list (active session)
# select and kill the selected-window
# Get the current tmux session
TMUX_SESSION=$(tmux display-message -p '#S')
# Get a list of windows in the current session