Rename use_nerd_icons to use_icons

use_nerd_icons meant using special characters to display information. As
in user could use emojis or even strings to display information. The
parameter name seemed kind of misleading. Hence, renaming it.
This commit is contained in:
aditya-K2
2023-05-14 01:28:39 +05:30
parent a04c2b3067
commit 513861b4fd
4 changed files with 13 additions and 13 deletions

View File

@@ -130,8 +130,8 @@ Usage of gspt:
Specify The Directory to check for config.yml file. (default "$XDG_CONFIG_HOME/gspt") Specify The Directory to check for config.yml file. (default "$XDG_CONFIG_HOME/gspt")
-hide-image -hide-image
Do not display the cover art image. Do not display the cover art image.
-nerd-icons -icons
Use Nerd Icons Use Icons
-rounded-corners -rounded-corners
Enable Rounded Corners Enable Rounded Corners
``` ```
@@ -164,8 +164,8 @@ hide_image: false
# Enable Rounded Corners # Enable Rounded Corners
rounded_corners: false rounded_corners: false
# Use Nerd Icons # Use Special Characters to display information
use_nerd_icons: false use_icons: false
# Image Drawing related parameters. You aren't supposed to define them manually. # Image Drawing related parameters. You aren't supposed to define them manually.
# See the next section to see how you can calibrate the Image placement. # See the next section to see how you can calibrate the Image placement.
@@ -247,7 +247,7 @@ icons:
icons: icons:
computer: "🖥️" computer: "🖥️"
# Note: icons are used only if `use_nerd_icons` is true # Note: icons are used only if `use_icons` is true
# For the default icons used and all available icon names please see: # For the default icons used and all available icon names please see:
# https://github.com/aditya-K2/gspt/blob/master/extras/CONFIG.md # https://github.com/aditya-K2/gspt/blob/master/extras/CONFIG.md

View File

@@ -28,7 +28,7 @@ type ConfigS struct {
ImageWidthExtraY int `yaml:"image_width_extra_y" mapstructure:"image_width_extra_y"` ImageWidthExtraY int `yaml:"image_width_extra_y" mapstructure:"image_width_extra_y"`
HideImage bool `yaml:"hide_image" mapstructure:"hide_image"` HideImage bool `yaml:"hide_image" mapstructure:"hide_image"`
RoundedCorners bool `yaml:"rounded_corners" mapstructure:"rounded_corners"` RoundedCorners bool `yaml:"rounded_corners" mapstructure:"rounded_corners"`
UseNerdIcons bool `yaml:"use_nerd_icons" mapstructure:"use_nerd_icons"` UseIcons bool `yaml:"use_icons" mapstructure:"use_icons"`
} }
func NewConfigS() *ConfigS { func NewConfigS() *ConfigS {
@@ -80,8 +80,8 @@ func ReadConfig() {
if Flags.RoundedCorners != false { if Flags.RoundedCorners != false {
Config.RoundedCorners = Flags.RoundedCorners Config.RoundedCorners = Flags.RoundedCorners
} }
if Flags.UseNerdIcons != false { if Flags.UseIcons != false {
Config.UseNerdIcons = Flags.UseNerdIcons Config.UseIcons = Flags.UseIcons
} }
} }
useFlags() useFlags()

View File

@@ -12,7 +12,7 @@ type Flag struct {
ConfigPath string ConfigPath string
HideImage bool HideImage bool
RoundedCorners bool RoundedCorners bool
UseNerdIcons bool UseIcons bool
} }
func parseFlags() { func parseFlags() {
@@ -22,7 +22,7 @@ func parseFlags() {
"Do not display the cover art image.") "Do not display the cover art image.")
flag.BoolVar(&Flags.RoundedCorners, "rounded-corners", Config.RoundedCorners, flag.BoolVar(&Flags.RoundedCorners, "rounded-corners", Config.RoundedCorners,
"Enable Rounded Corners") "Enable Rounded Corners")
flag.BoolVar(&Flags.UseNerdIcons, "nerd-icons", Config.UseNerdIcons, flag.BoolVar(&Flags.UseIcons, "icons", Config.UseIcons,
"Use Nerd Icons") "Use Icons")
flag.Parse() flag.Parse()
} }

View File

@@ -147,7 +147,7 @@ func progressRoutine() {
} }
func deviceIcon(d spotify.PlayerDevice) string { func deviceIcon(d spotify.PlayerDevice) string {
if val, ok := devices[strings.ToLower(d.Type)]; cfg.UseNerdIcons && ok { if val, ok := devices[strings.ToLower(d.Type)]; cfg.UseIcons && ok {
return val return val
} }
return "Device:" return "Device:"
@@ -164,7 +164,7 @@ func topTitle(playing, shuffle bool, repeat string, device spotify.PlayerDevice)
playState = "Playing" playState = "Playing"
} }
if cfg.UseNerdIcons { if cfg.UseIcons {
icon = playIcons[playing] icon = playIcons[playing]
icon += " " icon += " "
repeat = repeatIcons[repeat] repeat = repeatIcons[repeat]