mirror of
https://github.com/hyprwm/hyprpicker.git
synced 2024-12-22 06:09:48 +01:00
core: add --version
This commit is contained in:
parent
ed3f644af7
commit
e22a8d437b
3 changed files with 11 additions and 3 deletions
|
@ -10,6 +10,8 @@ project(
|
|||
|
||||
set(CMAKE_MESSAGE_LOG_LEVEL "STATUS")
|
||||
|
||||
add_compile_definitions(HYPRPICKER_VERSION="${VERSION}")
|
||||
|
||||
message(STATUS "Configuring hyprpicker!")
|
||||
|
||||
# Get git info hash and branch
|
||||
|
|
|
@ -387,7 +387,7 @@ void CHyprpicker::renderSurface(CLayerSurface* pSurface, bool forceInactive) {
|
|||
if (!m_bNoZoom) {
|
||||
cairo_save(PCAIRO);
|
||||
|
||||
const auto CLICKPOSBUF = CLICKPOS / PBUFFER->pixelSize * pSurface->screenBuffer->pixelSize;
|
||||
const auto CLICKPOSBUF = CLICKPOS / PBUFFER->pixelSize * pSurface->screenBuffer->pixelSize;
|
||||
|
||||
const auto PIXCOLOR = getColorFromPixel(pSurface, CLICKPOSBUF);
|
||||
cairo_set_source_rgba(PCAIRO, PIXCOLOR.r / 255.f, PIXCOLOR.g / 255.f, PIXCOLOR.b / 255.f, PIXCOLOR.a / 255.f);
|
||||
|
|
10
src/main.cpp
10
src/main.cpp
|
@ -14,7 +14,8 @@ static void help(void) {
|
|||
<< " -z | --no-zoom | Disable the zoom lens\n"
|
||||
<< " -q | --quiet | Disable most logs (leaves errors)\n"
|
||||
<< " -v | --verbose | Enable more logs\n"
|
||||
<< " -t | --no-fractional | Disable fractional scaling support\n";
|
||||
<< " -t | --no-fractional | Disable fractional scaling support\n"
|
||||
<< " -V | --version | Print version info\n";
|
||||
}
|
||||
|
||||
int main(int argc, char** argv, char** envp) {
|
||||
|
@ -31,9 +32,10 @@ int main(int argc, char** argv, char** envp) {
|
|||
{"no-fractional", no_argument, NULL, 't'},
|
||||
{"quiet", no_argument, NULL, 'q'},
|
||||
{"verbose", no_argument, NULL, 'v'},
|
||||
{"version", no_argument, NULL, 'V'},
|
||||
{NULL, 0, NULL, 0}};
|
||||
|
||||
int c = getopt_long(argc, argv, ":f:hnarzqvt", long_options, &option_index);
|
||||
int c = getopt_long(argc, argv, ":f:hnarzqvtV", long_options, &option_index);
|
||||
if (c == -1)
|
||||
break;
|
||||
|
||||
|
@ -62,6 +64,10 @@ int main(int argc, char** argv, char** envp) {
|
|||
case 't': g_pHyprpicker->m_bNoFractional = true; break;
|
||||
case 'q': Debug::quiet = true; break;
|
||||
case 'v': Debug::verbose = true; break;
|
||||
case 'V': {
|
||||
std::cout << "hyprpicker v" << HYPRPICKER_VERSION << "\n";
|
||||
exit(0);
|
||||
}
|
||||
|
||||
default: help(); exit(1);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue