(Translated by https://www.hiragana.jp/)
GitHub - Pheon-Dev/pigeon: Neovim plugin packed with modules ( battery, wifi, date, time, day etc) to litter the statusline and winbar
Skip to content

Neovim plugin packed with modules ( battery, wifi, date, time, day etc) to litter the statusline and winbar

Notifications You must be signed in to change notification settings

Pheon-Dev/pigeon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Linux macOS Windows

Pigeon

cher-ami

This plugin adds to the current statusline and winbar by providing modules such as wifi, battery, volume, date, time, cpu, ram and storage.

This plugin is currently in it's experimental stages. Expect some breaking changes. Please feel free to use it and file any issues and PRs whenever the pigeon is not feeding correctly, doesn't home, gets lost, nests a lot and does nothing or gets shot.

Polite reminder: use the modules you only need, not all of them. Pigeons don't carry parcels.

online offline


Installation

Lazy

    {
        "Pheon-Dev/pigeon",
        event = "",
        config = function()
            local config = {
                enabled = true,
                os = "linux", -- windows, osx
                plugin_manager = "lazy", -- packer, paq, vim-plug
                callbacks = {
                    killing_pigeon = nil,
                    respawning_pigeon = nil,
                },
                -- more config options here
            }

            require("pigeon").setup(config)
        end
    }

Available Modules

-- battery
require("pigeon.battery").battery()

-- internet
require("pigeon.internet").wifi()

-- date and time
require("pigeon.datetime").current_date()
require("pigeon.datetime").current_day()
require("pigeon.datetime").current_time()

-- ram
require("pigeon.ram").ram()

-- hostname
require("pigeon.hostname").hostname()

-- cpu
require("pigeon.cpu").cpu() -- still working on it

-- volume
require("pigeon.volume").volume()

Usage

-- Example in lualine
...
sections = {
  ...
      lualine_x = {
          {
            function()
                local enabled = require("pigeon.config").options.battery.enabled
                local battery = require("pigeon.battery").battery()

                if enabled then
                  return battery
                else
                  return ""
                end
            end,
          }
      },
      ...
    },
...

Commands

  • PigeonToggle: Toggle the entire plugin by either killing the pigeon or respawning it

Battery Module

  • PigeonToggleBattery: Toggle the battery modules and its submodules
  • PigeonToggleBatteryStatus: Toggle the battery status submodule
  • PigeonToggleBatteryCapacity: Toggle the battery capacity icon submodule
  • PigeonToggleBatteryCharge: Toggle the battery charge and it's percentage submodule

Internet Module

  • PigeonToggleInternet: Toggle the internet module and its submodules
  • PigeonToggleEthernet: Toggle the ethernet submodule
  • PigeonToggleWifi: Toggle the wifi icon submodule
  • PigeonToggleBitRate: Toggle the bitrate submodule
  • PigeonToggleEssid: Toggle the ESSID submodule(wifi name)

Date and Time Module

  • PigeonToggleDateTime: Toggle the date and time modules and its submodules
  • PigeonToggleDate: Toggle the date submodule
  • PigeonToggleTime: Toggle the time submodule
  • PigeonToggleDay: Toggle the day submodule

Audio Module

  • PigeonToggleVolume: Toggle audio module
local map = vim.api.nvim_set_keymap
map("n", "<leader>pp", ":PigeonToggle<CR>", { silent = true, desc = "Toggle All Pigeon Modules" })
map("n", "<leader>pd", ":PigeonToggleDateTime<CR>", { silent = true, desc = "Toggle Date and Time Module" })
map("n", "<leader>pi", ":PigeonToggleInternet<CR>", { silent = true, desc = "Toggle Internet Module" })
map("n", "<leader>pb", ":PigeonToggleBattery<CR>", { silent = true, desc = "Toggle Battery Module" })
...

Modules

  • battery
    • capacity icon
    • charge percentage
    • status i.e charging, discharging
    • animated battery icon while charging
    • toggle
  • internet
    • wifi connection
      • wifi essid
    • ethernet connection
    • internet connection speed
      • bit rate
    • toggle
  • date and time
    • current date
    • current time
    • current day
    • toggle
  • cpu
    • System processor usage
    • toggle
  • ram
    • System memory usage
    • toggle
  • updates
    • Neovim plugins updates
    • toggle
  • music
    • current music playing
    • toggle
  • volume
    • audio volume
    • toggle

Configuration

require("pigeon").setup({
	enabled = true,
	os = "linux", -- windows, osx
	plugin_manager = "lazy", -- packer, paq, vim-plug
	updates = {
		enabled = true,
		pretext = "",
		posttext = "",
		icon = "󱌖 ",
	},
	datetime = {
		enabled = true,
		time = {
			enabled = true,
			format = "%H:%M",
			posttext = "hrs",
			icon = "󰃰 ",
		},
		day = {
			enabled = true,
			format = "%A",
			icon = "󰃶 ",
		},
		date = {
			enabled = true,
			format = "%Y-%m-%d",
			icon = "",
		},
	},
	battery = {
		enabled = true,
		show_percentage = true,
		show_status_text = false,
		view = {
			charge = {
				zeros = { icon = "󰂎 " },
				tens = { icon = "󰁺 " },
				twenties = { icon = "󰁻 " },
				thirties = { icon = "󰁼 " },
				forties = { icon = "󰁽 " },
				fifties = { icon = "󰁾 " },
				sixties = { icon = "󰁿 " },
				seventies = { icon = "󰂀 " },
				eighties = { icon = "󰂁 " },
				nineties = { icon = "󰂂 " },
				hundred = { icon = "󰁹 " },
			},
			status = {
				enabled = true,
				charging = { icon = " 󱐋" },
				discharging = { icon = " 󱐌" },
				not_charging = { icon = "" },
				full = { icon = "" },
				unknown = { icon = "" },
				critical = { icon = "" },
				percentage = { icon = " 󰏰" },
			},
		},
	},
	internet = {
		enabled = true,
		signal = {
			enabled = true,
			unit = "mbps", -- mbps | mb/s | Mb/s | MB/s | Mbps | MBps
		},
		ethernet = {
			enabled = true,
			icons = {
				connected = "󰞉 ",
				disconnected = "󰕑 ",
			},
		},
    wifi = {
      status = {
        connected = "󰤪",
        disconnected = "󰤫",
        enabled = true,
      },
      essid = {
        enabled = true,
      },
      bit_rate = {
        enabled = true,
        unit = "mbps", -- or dbm
      }
    },
	},
	volume = {
		enabled = true,
		show_percentage = false,
		icons = {
			low = "󰕿",
			medium = "󰖀",
			high = "󰕾",
			mute = "󰝟",
		},
	},
	temperature = {
		enabled = true,
		show_percentage = false,
		icon = "",
	},
	storage = {
		enabled = true,
		show_percentage = false,
		icon = "󱛟",
	},
	ram = {
		enabled = true,
		show_percentage = false,
		icon = "󰍛",
	},
	cpu = {
		enabled = true,
		show_percentage = false,
		icon = "󰻠",
	},
})

Contributions

no pigeons where harmed or killed in the making of this plugin

  • PRs and Issues are always welcome.